MCPcopy Create free account
hub / github.com/PaesslerAG/jsonpath / matcher

Method matcher

path.go:31–41  ·  view source on GitHub ↗
(ctx context.Context, r interface{}, match ambiguousMatcher)

Source from the content-addressed store, hash-verified

29}
30
31func (p plainPath) matcher(ctx context.Context, r interface{}, match ambiguousMatcher) ambiguousMatcher {
32 if len(p) == 0 {
33 return match
34 }
35 return func(k, v interface{}) {
36 res, err := p.evaluatePath(ctx, r, v)
37 if err == nil {
38 match(k, res)
39 }
40 }
41}
42
43func (p plainPath) visitMatchs(ctx context.Context, r interface{}, visit pathMatcher) {
44 res, err := p.evaluatePath(ctx, r, r)

Callers 2

visitMatchsMethod · 0.45
visitElementsMethod · 0.45

Calls 1

evaluatePathMethod · 0.95

Tested by

no test coverage detected