Documentation
¶
Index ¶
- func DirModuleLoader(basePath string) gojq.ModuleLoader
- func Eval(ctx context.Context, opts EvalOptions) (string, error)
- func Extract(ctx context.Context, opts EvalOptions) (map[string]any, error)
- func ForEach(ctx context.Context, opts EvalOptions, action func(any) error) error
- func InferType(value string) any
- func MaybeQuery(s string) (string, bool)
- type EvalOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirModuleLoader ¶
func DirModuleLoader(basePath string) gojq.ModuleLoader
func InferType ¶
InferType attempts to infer and convert a string value to its most appropriate Go type. It supports primitive types (bool, int32, int64, float64, string), as well as structured types commonly found in Kubernetes configurations (map[string]any and []any). The function first tries to parse the input as JSON. If that fails, it falls back to custom parsing logic for booleans, nil/null, integers, and floats. If no conversion is possible, the original string is returned.
func MaybeQuery ¶
Types ¶
type EvalOptions ¶
type EvalOptions struct {
Query string
Unquote bool
Data any
ModuleLoader gojq.ModuleLoader
}
Click to show internal directories.
Click to hide internal directories.