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

Method getRevision

db/revision_cache_test.go:67–83  ·  view source on GitHub ↗
(ctx context.Context, doc *Document, revid string)

Source from the content-addressed store, hash-verified

65}
66
67func (t *testBackingStore) getRevision(ctx context.Context, doc *Document, revid string) ([]byte, AttachmentsMeta, base.Set, error) {
68 t.getRevisionCounter.Add(1)
69
70 revTreeID := doc.GetRevTreeID()
71 ch, _ := doc.channelsForRevTreeID(revTreeID)
72 b := Body{
73 "testing": true,
74 BodyId: doc.ID,
75 BodyRev: revTreeID,
76 BodyRevisions: Revisions{RevisionsStart: 1},
77 }
78 if doc.HLV != nil {
79 b[BodyCV] = doc.HLV.GetCurrentVersionString()
80 }
81 bodyBytes, err := base.JSONMarshal(b)
82 return bodyBytes, nil, ch, err
83}
84
85func (t *testBackingStore) getCurrentVersion(ctx context.Context, doc *Document, cv Version, loadBackup bool) ([]byte, AttachmentsMeta, base.Set, bool, error) {
86 t.getRevisionCounter.Add(1)

Callers

nothing calls this directly

Calls 5

JSONMarshalFunction · 0.92
channelsForRevTreeIDMethod · 0.80
AddMethod · 0.45
GetRevTreeIDMethod · 0.45

Tested by

no test coverage detected