jq

package
v5.63.21 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 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

Overview

Package jq compiles and runs the jq programs a workflow step reshapes its result with (the step's `jq` field), on gojq, a pure-Go jq.

A program sees the step's result as its input and the workflow input and loop variables as $input and $vars. It must yield one value: a program that yields a stream is wrapped in [ ] to collect it, so the stored result never depends on how many rows the data happened to hold.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(source string) error

Check reports why a jq program does not compile, nil when it does.

Types

type Cache

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

Cache holds compiled programs by their source, so a step inside a loop is compiled once, not once per iteration. It is safe for concurrent use.

func (*Cache) Get

func (c *Cache) Get(source string) (*Program, error)

Get returns the compiled program for source, compiling it on first use.

type Program

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

Program is a compiled jq program.

func Compile

func Compile(source string) (*Program, error)

Compile parses and compiles a jq program.

func (*Program) Run

func (p *Program) Run(ctx context.Context, input interface{}, workflowInput, vars map[string]interface{}) (interface{}, error)

Run runs the program on input with the workflow input and loop variables bound to $input and $vars. It returns the one value the program yields, nil when it yields none, and an error when it yields more than one or fails.

Jump to

Keyboard shortcuts

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