jq

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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