jq

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package jq facilitates processing of JSON strings using jq expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileExpression

func CompileExpression(expr string) (*gojq.Code, error)

func Evaluate

func Evaluate(input io.Reader, output io.Writer, expr string) error

Evaluate a jq expression against an input and write it to an output. Any top-level scalar values produced by the jq expression are written out directly, as raw values and not as JSON scalars, similar to how jq --raw works.

func EvaluateData

func EvaluateData(expr string, data any) (any, error)

func EvaluateFormatted

func EvaluateFormatted(input io.Reader, output io.Writer, expr string, indent string, colorize bool) error

Evaluate a jq expression against an input and write it to an output, optionally with indentation and colorization. Any top-level scalar values produced by the jq expression are written out directly, as raw values and not as JSON scalars, similar to how jq --raw works.

Types

This section is empty.

Jump to

Keyboard shortcuts

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