jsonpath

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 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

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