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

Function stripNonJSONPrefix

db/revision_old.go:40–45  ·  view source on GitHub ↗

stripNonJSONPrefix removes the non-JSON prefix byte and returns the kind and the remainder of the byte slice.

(data []byte)

Source from the content-addressed store, hash-verified

38
39// stripNonJSONPrefix removes the non-JSON prefix byte and returns the kind and the remainder of the byte slice.
40func stripNonJSONPrefix(data []byte) (kind nonJSONPrefix, body []byte) {
41 if len(data) <= 1 {
42 return nonJSONPrefixKindUnknown, nil
43 }
44 return nonJSONPrefix(data[0]), data[1:]
45}
46
47// setOldRevisionJSONPtr stores a pointer from the old revision's RevTreeID to the Current Version hash used to fetch the body.
48func (db *DatabaseCollectionWithUser) setOldRevisionJSONPtr(ctx context.Context, doc *Document, expiry uint32) error {

Callers 1

getOldRevisionJSONMethod · 0.85

Calls 1

nonJSONPrefixTypeAlias · 0.85

Tested by

no test coverage detected