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

Function containerStart

parser.go:2047–2066  ·  view source on GitHub ↗

SYS-REQ-112

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

Source from the content-addressed store, hash-verified

2045
2046// SYS-REQ-112
2047func containerStart(data []byte, open byte, keys ...string) (int, error) {
2048 offset := 0
2049 if len(keys) > 0 {
2050 offset = searchKeys(data, keys...)
2051 if offset == -1 {
2052 return -1, KeyPathNotFoundError
2053 }
2054 }
2055
2056 tokenOffset := nextToken(data[offset:])
2057 if tokenOffset == -1 {
2058 return -1, KeyPathNotFoundError
2059 }
2060 offset += tokenOffset
2061
2062 if data[offset] != open {
2063 return -1, KeyPathNotFoundError
2064 }
2065 return offset, nil
2066}
2067
2068// SYS-REQ-112
2069func 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