MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / EncodeJSONArrayKeyMarker

Function EncodeJSONArrayKeyMarker

pkg/util/encoding/encoding.go:3589–3604  ·  view source on GitHub ↗

EncodeJSONArrayKeyMarker adds a JSON Array key encoding marker to buf and returns the new buffer.

(buf []byte, dir Direction, arrayLength int64)

Source from the content-addressed store, hash-verified

3587// EncodeJSONArrayKeyMarker adds a JSON Array key encoding marker
3588// to buf and returns the new buffer.
3589func EncodeJSONArrayKeyMarker(buf []byte, dir Direction, arrayLength int64) []byte {
3590 switch dir {
3591 case Ascending:
3592 if arrayLength == 0 {
3593 return append(buf, jsonEmptyArrayKeyMarker)
3594 }
3595 return append(buf, jsonArrayKeyMarker)
3596 case Descending:
3597 if arrayLength == 0 {
3598 return append(buf, jsonEmptyArrayKeyDescendingMarker)
3599 }
3600 return append(buf, jsonArrayKeyDescendingMarker)
3601 default:
3602 panic("invalid direction")
3603 }
3604}
3605
3606// EncodeJSONKeyTerminator adds a JSON Key terminator
3607// to buf and returns the buffer.

Callers 1

EncodeForwardIndexMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…