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

Function containerStart

parser.go:2139–2158  ·  view source on GitHub ↗

SYS-REQ-112

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

Source from the content-addressed store, hash-verified

2137
2138// SYS-REQ-112
2139func containerStart(data []byte, open byte, keys ...string) (int, error) {
2140 offset := 0
2141 if len(keys) > 0 {
2142 offset = searchKeys(data, keys...)
2143 if offset == -1 {
2144 return -1, KeyPathNotFoundError
2145 }
2146 }
2147
2148 tokenOffset := nextToken(data[offset:])
2149 if tokenOffset == -1 {
2150 return -1, KeyPathNotFoundError
2151 }
2152 offset += tokenOffset
2153
2154 if data[offset] != open {
2155 return -1, KeyPathNotFoundError
2156 }
2157 return offset, nil
2158}
2159
2160// SYS-REQ-112
2161func 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