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

Method EncodeForwardIndex

pkg/util/json/json.go:2036–2049  ·  view source on GitHub ↗
(buf []byte, dir encoding.Direction)

Source from the content-addressed store, hash-verified

2034}
2035
2036func (j jsonString) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2037 buf = encoding.EncodeJSONStringKeyMarker(buf, dir)
2038
2039 switch dir {
2040 case encoding.Ascending:
2041 buf = encoding.EncodeStringAscending(buf, string(j))
2042 case encoding.Descending:
2043 buf = encoding.EncodeStringDescending(buf, string(j))
2044 default:
2045 return nil, errors.AssertionFailedf("invalid direction")
2046 }
2047 buf = encoding.EncodeJSONKeyTerminator(buf, dir)
2048 return buf, nil
2049}
2050
2051func (j jsonNumber) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2052 buf = encoding.EncodeJSONNumberKeyMarker(buf, dir)

Callers

nothing calls this directly

Calls 4

EncodeStringAscendingFunction · 0.92
EncodeStringDescendingFunction · 0.92
EncodeJSONKeyTerminatorFunction · 0.92

Tested by

no test coverage detected