getRESTkeyspace returns a keyspace for REST URIs
(_ testing.TB, dbName string, collection *db.DatabaseCollection)
| 2469 | |
| 2470 | // getRESTkeyspace returns a keyspace for REST URIs |
| 2471 | func getRESTKeyspace(_ testing.TB, dbName string, collection *db.DatabaseCollection) string { |
| 2472 | if base.IsDefaultCollection(collection.ScopeName, collection.Name) { |
| 2473 | // for backwards compatibility (and user-friendliness), |
| 2474 | // we can optionally just use `/db/` instead of `/db._default._default/` |
| 2475 | // Return this format to get coverage of both formats. |
| 2476 | return dbName |
| 2477 | } |
| 2478 | return strings.Join([]string{dbName, collection.ScopeName, collection.Name}, base.ScopeCollectionSeparator) |
| 2479 | } |
| 2480 | |
| 2481 | // getScopeAndCollectionFromKeyspace returns the scope and collection from a keyspace, e.g. /db/ -> _default._default , or /db.scope1.collection1 -> scope1.collection1 |
| 2482 | func getScopeAndCollectionFromKeyspace(t testing.TB, keyspace string) string { |
no test coverage detected