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 ¶
func (c *CompiledJSONPath) Execute(u unstructured.Unstructured) (string, error)
Execute applies a precompiled JSONPath to the given object and returns the extracted value.
Click to show internal directories.
Click to hide internal directories.