jsonpath

package
v4.0.0-...-b272d28 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchResult

type MatchResult struct {
	Matched bool
	Found   string
	Message string
}

MatchResult contains information about a JSONPath match.

type Parsed

type Parsed struct {
	Path  string // The JSONPath expression.
	Value string // An optional value to test for equality against.
	// contains filtered or unexported fields
}

Parsed is a parsed JSONPath expression with an optional value.

func Parse

func Parse(expr string) (*Parsed, error)

Parse parses a single JSONPath expression. Only the strict syntax of `kubectl get -o jsonpath={...}` is accepted, because the "relaxed" syntax used by `wait` is somewhat buggy.

func (*Parsed) Matches

func (i *Parsed) Matches(uns *unstructured.Unstructured) (MatchResult, error)

Matches returns true if the JSONPath matches against the given object. If the JSONPath didn't include a value, then this will return true if the path exists. Otherwise, the path must exist and hold a value equal to the Instance's expected value.

func (*Parsed) String

func (i *Parsed) String() string

Jump to

Keyboard shortcuts

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