jsonpath

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateTruthyFromCompiled

func EvaluateTruthyFromCompiled(u unstructured.Unstructured, compiled *CompiledJSONPath) (bool, error)

EvaluateTruthyFromCompiled evaluates a compiled JSONPath expression and interprets the result using "truthy" semantics:

  • empty result => false
  • "false" (case-insensitive) => false
  • "0" => false
  • anything else non-empty => true

func SplitFieldSelectorEquals added in v0.13.4

func SplitFieldSelectorEquals(raw string) (path string, value string, ok bool)

func SplitFieldSelectorNotEquals added in v0.13.8

func SplitFieldSelectorNotEquals(raw string) (path string, value string, ok bool)

SplitFieldSelectorNotEquals parses a raw field selector of the form "path!=value" and returns the path, value, and whether the not-equal operator was found at the top level.

Types

type CompiledJSONPath

type CompiledJSONPath struct {
	// contains filtered or unexported fields
}

CompiledJSONPath wraps a parsed JSONPath expression for repeated use.

func CompileJSONPath

func CompileJSONPath(sourcePath string) (*CompiledJSONPath, error)

CompileJSONPath parses and validates a JSONPath source path once. Example sourcePath: ".spec.resources.requests.cpu".

func (*CompiledJSONPath) Execute

Execute applies a precompiled JSONPath to the given object and returns the extracted value.

Jump to

Keyboard shortcuts

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