MCPcopy Create free account
hub / github.com/buger/jsonparser / containerStart

Function containerStart

parser.go:2179–2198  ·  view source on GitHub ↗

SYS-REQ-112

(data []byte, open byte, keys ...string)

Source from the content-addressed store, hash-verified

2177
2178// SYS-REQ-112
2179func containerStart(data []byte, open byte, keys ...string) (int, error) {
2180 offset := 0
2181 if len(keys) > 0 {
2182 offset = searchKeys(data, keys...)
2183 if offset == -1 {
2184 return -1, KeyPathNotFoundError
2185 }
2186 }
2187
2188 tokenOffset := nextToken(data[offset:])
2189 if tokenOffset == -1 {
2190 return -1, KeyPathNotFoundError
2191 }
2192 offset += tokenOffset
2193
2194 if data[offset] != open {
2195 return -1, KeyPathNotFoundError
2196 }
2197 return offset, nil
2198}
2199
2200// SYS-REQ-112
2201func scanContainerLen(data []byte, offset int, open byte) (int, error) {

Callers 2

GetArrayLenFunction · 0.85
GetObjectLenFunction · 0.85

Calls 2

searchKeysFunction · 0.85
nextTokenFunction · 0.85

Tested by

no test coverage detected