MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / getRESTKeyspace

Function getRESTKeyspace

rest/utilities_testing.go:2471–2479  ·  view source on GitHub ↗

getRESTkeyspace returns a keyspace for REST URIs

(_ testing.TB, dbName string, collection *db.DatabaseCollection)

Source from the content-addressed store, hash-verified

2469
2470// getRESTkeyspace returns a keyspace for REST URIs
2471func 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
2482func getScopeAndCollectionFromKeyspace(t testing.TB, keyspace string) string {

Callers 3

getKeyspacesFunction · 0.85
GetKeyspacesMethod · 0.85
GetSingleKeyspaceMethod · 0.85

Calls 1

IsDefaultCollectionFunction · 0.92

Tested by

no test coverage detected