jq

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledJqFilter added in v1.15.3

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

CompiledJqFilter holds a pre-compiled gojq program. Compile once and reuse across many Apply calls to eliminate repeated parse+compile overhead.

func Compile added in v1.15.3

func Compile(jqFilter string) (*CompiledJqFilter, error)

Compile parses and compiles jqFilter once. The returned *CompiledJqFilter is safe for concurrent use and can be reused for every event that carries the same filter expression.

func (*CompiledJqFilter) Apply added in v1.15.3

func (c *CompiledJqFilter) Apply(data map[string]any) ([]byte, error)

Apply executes the pre-compiled jq program against data.

func (*CompiledJqFilter) String added in v1.15.3

func (c *CompiledJqFilter) String() string

String returns the original jq filter expression for diagnostics.

type Filter

type Filter struct{}

func NewFilter

func NewFilter() *Filter

func (*Filter) ApplyFilter

func (f *Filter) ApplyFilter(jqFilter string, data map[string]any) ([]byte, error)

ApplyFilter runs jq expression provided in jqFilter with jsonData as input.

func (*Filter) FilterInfo

func (f *Filter) FilterInfo() string

Jump to

Keyboard shortcuts

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