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

Function EachKeyWildcard

wildcard.go:15–18  ·  view source on GitHub ↗

EachKeyWildcard resolves a path that may contain [*] components. A wildcard requires an array at that position and fans out over its elements before resolving the rest of the path. Multiple wildcards produce one callback for every matching combination, in document order. idx is the zero-based order

(data []byte, cb func(idx int, value []byte, vt ValueType, err error), path ...string)

Source from the content-addressed store, hash-verified

13//
14// SYS-REQ-113
15func EachKeyWildcard(data []byte, cb func(idx int, value []byte, vt ValueType, err error), path ...string) error {
16 nextMatch := 0
17 return eachKeyWildcard(data, cb, &nextMatch, path)
18}
19
20// SYS-REQ-113
21func eachKeyWildcard(data []byte, cb func(idx int, value []byte, vt ValueType, err error), nextMatch *int, path []string) error {

Calls 1

eachKeyWildcardFunction · 0.85

Tested by 2

TestEachKeyWildcardFunction · 0.68