Documentation
¶
Overview ¶
Package jqutil provides shared gojq utilities used by multiple packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SecureCompileOpts = []gojq.CompilerOption{ gojq.WithEnvironLoader(func() []string { return nil }), }
SecureCompileOpts are the gojq compiler options applied to every Compile call in this project. Centralising them here ensures the security intent ($ENV disabled) is never accidentally omitted from a future compile site.
Both internal/config and internal/middleware need identical options. Defining them once in this leaf package removes the duplication and guards against the two copies drifting apart.
Functions ¶
func CompileOptsWithVariables ¶ added in v0.4.2
func CompileOptsWithVariables(varNames []string) []gojq.CompilerOption
CompileOptsWithVariables returns a new slice combining SecureCompileOpts with gojq.WithVariables for the given variable names. The returned slice is always a fresh allocation, so callers never mutate the shared SecureCompileOpts backing array.
func ParseErrorDetails ¶ added in v0.4.8
ParseErrorDetails returns a human-readable suffix (e.g. " at offset 3 (token "!")") when err wraps a *gojq.ParseError, or an empty string otherwise. EOF parse failures render the token as "<EOF>" for clearer diagnostics. Centralising the extraction here ensures that config validation and middleware filter compilation cannot diverge in their output.
Types ¶
This section is empty.