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

Function GetAttachmentVersion

db/attachment.go:341–348  ·  view source on GitHub ↗
(meta map[string]interface{})

Source from the content-addressed store, hash-verified

339}
340
341func GetAttachmentVersion(meta map[string]interface{}) (int, bool) {
342 ver, ok := meta["ver"]
343 if !ok {
344 return AttVersion1, true
345 }
346 val, ok := base.ToInt64(ver)
347 return int(val), ok
348}
349
350// GenerateProofOfAttachment returns a nonce and proof for an attachment body.
351func GenerateProofOfAttachment(ctx context.Context, attachmentData []byte) (nonce []byte, proof string, err error) {

Callers 7

handleGetAttachmentMethod · 0.92
TestGetAttVersionFunction · 0.85
handleAttachmentsFunction · 0.85
retrieveV2AttachmentsFunction · 0.85
loadAttachmentsDataMethod · 0.85
ToAttachmentStorageMetaFunction · 0.85

Calls 1

ToInt64Function · 0.92

Tested by 1

TestGetAttVersionFunction · 0.68