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

Function withNonJSONPrefix

db/revision_old.go:32–37  ·  view source on GitHub ↗

withNonJSONPrefix returns a new byte slice prefixed with a non-JSON byte. The input slice is not modified.

(kind nonJSONPrefix, body []byte)

Source from the content-addressed store, hash-verified

30
31// withNonJSONPrefix returns a new byte slice prefixed with a non-JSON byte. The input slice is not modified.
32func withNonJSONPrefix(kind nonJSONPrefix, body []byte) []byte {
33 buf := make([]byte, 1, len(body)+1)
34 buf[0] = byte(kind)
35 buf = append(buf, body...)
36 return buf
37}
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) {

Callers 3

setOldRevisionJSONMethod · 0.85
setOldRevisionJSONPtrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected