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

Method EncodeForwardIndex

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

Source from the content-addressed store, hash-verified

2074}
2075
2076func (j jsonArray) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2077 buf = encoding.EncodeJSONArrayKeyMarker(buf, dir, int64(len(j)))
2078 buf = encoding.EncodeJSONValueLength(buf, dir, int64(len(j)))
2079
2080 var err error
2081 for _, a := range j {
2082 buf, err = a.EncodeForwardIndex(buf, dir)
2083 if err != nil {
2084 return nil, err
2085 }
2086 }
2087 buf = encoding.EncodeJSONKeyTerminator(buf, dir)
2088 return buf, nil
2089}
2090
2091func (j jsonObject) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2092 buf = encoding.EncodeJSONObjectKeyMarker(buf, dir)

Callers

nothing calls this directly

Calls 4

EncodeJSONArrayKeyMarkerFunction · 0.92
EncodeJSONValueLengthFunction · 0.92
EncodeJSONKeyTerminatorFunction · 0.92
EncodeForwardIndexMethod · 0.65

Tested by

no test coverage detected