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

Method InsertMetadataDocument

base/bootstrap.go:312–324  ·  view source on GitHub ↗
(ctx context.Context, location, key string, value interface{})

Source from the content-addressed store, hash-verified

310}
311
312func (cc *CouchbaseCluster) InsertMetadataDocument(ctx context.Context, location, key string, value interface{}) (newCAS uint64, err error) {
313 if cc == nil {
314 return 0, errors.New("nil CouchbaseCluster")
315 }
316
317 b, teardown, err := cc.getBucket(ctx, location)
318 if err != nil {
319 return 0, err
320 }
321 defer teardown()
322
323 return cc.configPersistence.insertConfig(b.DefaultCollection(), key, value)
324}
325
326// WriteMetadataDocument writes a metadata document, and fails on CAS mismatch
327func (cc *CouchbaseCluster) WriteMetadataDocument(ctx context.Context, location, docID string, cas uint64, value interface{}) (newCAS uint64, err error) {

Callers

nothing calls this directly

Calls 2

getBucketMethod · 0.95
insertConfigMethod · 0.65

Tested by

no test coverage detected