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

Function GetRawSyncXattr

db/util_testing.go:955–962  ·  view source on GitHub ↗

GetRawSyncXattr retrieves the _sync xattr from the bucket without going through typical CRUD processing.

(t *testing.T, collection base.DataStore, docID string)

Source from the content-addressed store, hash-verified

953
954// GetRawSyncXattr retrieves the _sync xattr from the bucket without going through typical CRUD processing.
955func GetRawSyncXattr(t *testing.T, collection base.DataStore, docID string) SyncData {
956 xattrs, _, err := collection.GetXattrs(base.TestCtx(t), docID, []string{base.SyncXattrName})
957 require.NoError(t, err, "Could not find _sync xattr for %s", docID)
958 require.Contains(t, xattrs, base.SyncXattrName, "Could not find _sync xattr for %s", docID)
959 var syncData SyncData
960 require.NoError(t, base.JSONUnmarshal(xattrs[base.SyncXattrName], &syncData))
961 return syncData
962}
963
964// GetRawGlobalSync retrieves the _globalSync xattr. Fails if the xattr is not found.
965func GetRawGlobalSync(t *testing.T, collection base.DataStore, docID string) GlobalSyncData {

Calls 4

TestCtxFunction · 0.92
JSONUnmarshalFunction · 0.92
ContainsMethod · 0.65
GetXattrsMethod · 0.45