jq

package
v0.0.0-...-54d739a Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

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

Tool knows how to run JQ queries. Don't create instances of this directly, use the NewTool function instead.

func (*Tool) Query

func (t *Tool) Query(query string, input any, output any) error

Query the given query on the given input data and stores the result into the given output variable. An error will be returned if the query can't be parsed or if the data doesn't fit into the output variable.

func (*Tool) QueryBytes

func (t *Tool) QueryBytes(query string, input []byte, output any) error

QueryBytes is similar to Query, but it expects as input an array of bytes containing the JSON text.

func (*Tool) QueryString

func (t *Tool) QueryString(query string, input string, output any) error

QueryString is similar to Query, but it expects an input string containing JSON text.

type ToolBuilder

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

ToolBuilder contains the data needed to build a tool that knows how to run JQ queries. Don't create instances of this directly, use the NewTool function instead.

func NewTool

func NewTool() *ToolBuilder

NewTool creates a builder that can then be used to create a JQ tool.

func (*ToolBuilder) Build

func (b *ToolBuilder) Build() (result *Tool, err error)

Build uses the information stored in the builder to create a new JQ tool.

func (*ToolBuilder) SetLogger

func (b *ToolBuilder) SetLogger(value logr.Logger) *ToolBuilder

SetLogger sets the logger that the JQ tool will use to write the log. This is mandatory.

Jump to

Keyboard shortcuts

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