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

Method GetNamedDataStore

base/util_testing.go:121–130  ·  view source on GitHub ↗

GetNamedDataStore returns a named datastore from the TestBucket. Each number (starting from 0, indicates which data store you'll get.

(count int)

Source from the content-addressed store, hash-verified

119
120// GetNamedDataStore returns a named datastore from the TestBucket. Each number (starting from 0, indicates which data store you'll get.
121func (tb *TestBucket) GetNamedDataStore(count int) (DataStore, error) {
122 dataStoreNames := tb.GetNonDefaultDatastoreNames()
123 if len(dataStoreNames) == 0 {
124 tb.t.Fatalf("You are requesting a named datastore on TestBucket that has none.")
125 }
126 if count > len(dataStoreNames) {
127 tb.t.Fatalf("You are requesting more datastores %d than are available on this test instance %d", count, len(dataStoreNames))
128 }
129 return tb.Bucket.NamedDataStore(dataStoreNames[count])
130}
131
132// Return a sorted list of data store names
133func (tb *TestBucket) GetNonDefaultDatastoreNames() []sgbucket.DataStoreName {

Calls 3

FatalfMethod · 0.45
NamedDataStoreMethod · 0.45