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

Method DeleteMetadataDocument

base/bootstrap.go:367–380  ·  view source on GitHub ↗
(ctx context.Context, location, key string, cas uint64)

Source from the content-addressed store, hash-verified

365}
366
367func (cc *CouchbaseCluster) DeleteMetadataDocument(ctx context.Context, location, key string, cas uint64) (err error) {
368 if cc == nil {
369 return errors.New("nil CouchbaseCluster")
370 }
371
372 b, teardown, err := cc.getBucket(ctx, location)
373 if err != nil {
374 return err
375 }
376 defer teardown()
377
378 _, removeErr := cc.configPersistence.removeRawConfig(b.DefaultCollection(), key, gocb.Cas(cas))
379 return removeErr
380}
381
382// UpdateMetadataDocument retries on CAS mismatch
383func (cc *CouchbaseCluster) UpdateMetadataDocument(ctx context.Context, location, docID string, updateCallback func(bucketConfig []byte, rawBucketConfigCas uint64) (newConfig []byte, err error)) (newCAS uint64, err error) {

Callers

nothing calls this directly

Calls 3

getBucketMethod · 0.95
removeRawConfigMethod · 0.65
CasMethod · 0.65

Tested by

no test coverage detected