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

Function getWithTouch

db/special_docs.go:41–54  ·  view source on GitHub ↗
(dataStore base.DataStore, docID string, expirySecs int)

Source from the content-addressed store, hash-verified

39}
40
41func getWithTouch(dataStore base.DataStore, docID string, expirySecs int) ([]byte, error) {
42 var rawDocBytes []byte
43 var err error
44 if expirySecs > 0 {
45 expiry := base.SecondsToCbsExpiry(expirySecs)
46 rawDocBytes, _, err = dataStore.GetAndTouchRaw(docID, expiry)
47 } else {
48 rawDocBytes, _, err = dataStore.GetRaw(docID)
49 }
50 if err != nil {
51 return nil, err
52 }
53 return rawDocBytes, nil
54}
55
56func getSpecialBytes(dataStore base.DataStore, doctype string, docID string, localDocExpirySecs int) ([]byte, error) {
57 key := RealSpecialDocID(doctype, docID)

Callers 2

getLocalStatusDocFunction · 0.85
getSpecialBytesFunction · 0.85

Calls 3

SecondsToCbsExpiryFunction · 0.92
GetAndTouchRawMethod · 0.45
GetRawMethod · 0.45

Tested by

no test coverage detected