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

Method GetWithRev

db/revision_cache_lru.go:163–165  ·  view source on GitHub ↗

Looks up a revision from the cache. Returns the body of the revision, its history, and the set of channels it's in. If the cache has a loaderFunction, it will be called if the revision isn't in the cache; any error returned by the loaderFunction will be returned from Get.

(ctx context.Context, docID, revID string, collectionID uint32, includeDelta bool)

Source from the content-addressed store, hash-verified

161// If the cache has a loaderFunction, it will be called if the revision isn't in the cache;
162// any error returned by the loaderFunction will be returned from Get.
163func (rc *LRURevisionCache) GetWithRev(ctx context.Context, docID, revID string, collectionID uint32, includeDelta bool) (DocumentRevision, error) {
164 return rc.getFromCacheByRev(ctx, docID, revID, collectionID, true, includeDelta)
165}
166
167func (rc *LRURevisionCache) GetWithCV(ctx context.Context, docID string, cv *Version, collectionID uint32, includeDelta bool, loadBackup bool) (DocumentRevision, error) {
168 return rc.getFromCacheByCV(ctx, docID, cv, collectionID, true, includeDelta, loadBackup)

Calls 1

getFromCacheByRevMethod · 0.95