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

Method GetMetadataDocument

base/bootstrap.go:294–310  ·  view source on GitHub ↗
(ctx context.Context, location, docID string, valuePtr interface{})

Source from the content-addressed store, hash-verified

292}
293
294func (cc *CouchbaseCluster) GetMetadataDocument(ctx context.Context, location, docID string, valuePtr interface{}) (cas uint64, err error) {
295 if cc == nil {
296 return 0, errors.New("nil CouchbaseCluster")
297 }
298
299 b, teardown, err := cc.getBucket(ctx, location)
300
301 if err != nil {
302 return 0, err
303 }
304
305 defer teardown()
306
307 cas, err = cc.configPersistence.loadConfig(ctx, b.DefaultCollection(), docID, valuePtr)
308 SyncGatewayStats.GlobalStats.ResourceUtilizationStats().NumIdleKvOps.Add(1)
309 return cas, err
310}
311
312func (cc *CouchbaseCluster) InsertMetadataDocument(ctx context.Context, location, key string, value interface{}) (newCAS uint64, err error) {
313 if cc == nil {

Callers

nothing calls this directly

Calls 4

getBucketMethod · 0.95
loadConfigMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected