textquery

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleQueryResult added in v0.5.8

func HandleQueryResult(
	result []interface{},
	marshalFunc func(in interface{}) ([]byte, error),
) string

HandleQueryResult from RunQuery

func JQ

func JQ(query, data string) (string, error)

JQ runs query over json data

func JQBytes

func JQBytes(query string, dataBytes []byte) (string, error)

JQ runs query over json data bytes

func NewJSONIterator added in v0.6.4

func NewJSONIterator(r io.Reader) func() (interface{}, bool)

func NewYAMLIterator added in v0.6.4

func NewYAMLIterator(r io.Reader) func() (interface{}, bool)

func Query added in v0.5.8

func Query(
	query string,
	generatNext func() (interface{}, bool),
	marshalFunc func(in interface{}) ([]byte, error),
) (string, error)

Query runs jq query over general text data bytes with custom marshaling/unmarshaling func for data serialization/deserialization

func RunQuery

func RunQuery(
	query *gojq.Query,
	data interface{},
	kvPairs map[string]interface{},
) ([]interface{}, bool, error)

RunQuery runs jq query over arbitrary data with optional predefined key value pairs

func YQ added in v0.5.8

func YQ(query, data string) (string, error)

JQ runs query over json data

func YQBytes added in v0.5.8

func YQBytes(query string, dataBytes []byte) (string, error)

JQ runs query over yaml data bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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