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

Function DocMetadataFromDocVersion

topologytest/version_test.go:86–99  ·  view source on GitHub ↗

DocMetadataFromDocVersion returns metadata DocVersion from the given document and version.

(t testing.TB, docID string, hlv *db.HybridLogicalVector, version rest.DocVersion)

Source from the content-addressed store, hash-verified

84
85// DocMetadataFromDocVersion returns metadata DocVersion from the given document and version.
86func DocMetadataFromDocVersion(t testing.TB, docID string, hlv *db.HybridLogicalVector, version rest.DocVersion) DocMetadata {
87 m := DocMetadata{
88 DocID: docID,
89 RevTreeID: version.RevTreeID,
90 ImplicitHLV: hlv,
91 }
92 if hlv != nil {
93 m.HLV = hlv
94 } else {
95 m.HLV = db.NewHybridLogicalVector()
96 require.NoError(t, m.HLV.AddVersion(version.CV))
97 }
98 return m
99}
100
101// assertHLVEqual asserts that the HLV of the version is equal to the expected HLV.
102func assertHLVEqual(t assert.TestingT, dsName sgbucket.DataStoreName, docID string, p string, version DocMetadata, body []byte, expected DocMetadata, topology Topology) {

Callers 4

getLatestDocVersionMethod · 0.85
CreateDocumentMethod · 0.85
WriteDocumentMethod · 0.85
DeleteDocumentMethod · 0.85

Calls 2

NewHybridLogicalVectorFunction · 0.92
AddVersionMethod · 0.80

Tested by

no test coverage detected