jsonpath

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchesRecord added in v1.13.0

func MatchesRecord(expression string, record map[string]interface{}) (bool, error)

MatchesRecord evaluates a kubectl-style JSONPath filter expression against an MMDB record. The expression is applied to a single-element slice that wraps the record, so @ refers directly to the record's fields:

{[?(@.country.iso_code=="US")]}

Returns true when the expression produces non-empty output (i.e. the filter matched), false when the output is empty (no match), and an error when the expression itself is invalid.

func ValidateExpression

func ValidateExpression(expression string) error

ValidateExpression parses the expression and returns an error if it is syntactically invalid. Call this once up-front to give users a clear error before starting any expensive iteration.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL