libjq

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JqFormatError

func JqFormatError(v C.jv) error

JqFormatError converts error in jv to Go's error

func JqInvalidError

func JqInvalidError(jv C.jv) error

JqInvalidError returns error if jv contains invaluid message

func JvArray

func JvArray(first C.jv, items ...C.jv) C.jv

JvArray returns a jv array value. jq sources has JV_ARRAY macros for this.

func JvArrayToGo added in v1.6.2

func JvArrayToGo(a C.jv) []string

func JvDumpString

func JvDumpString(str C.jv) string

JvDumpString

func JvString

func JvString(str string) C.jv

JvString copies Go string to C and return a jv_string

Types

type JqState

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

func NewJqState

func NewJqState() (*JqState, error)

func (*JqState) Compile

func (jq *JqState) Compile(program string) error

func (*JqState) CompileArgs

func (jq *JqState) CompileArgs(program string, argsJv C.jv) error

TODO create wrapper with errors catching

func (*JqState) ProcessOneValue

func (jq *JqState) ProcessOneValue(inJson string, rawMode bool) (string, error)

ProcessOneValue run a jq program over one json object.

Stream mode is not supported: stream splitting can be done by Go code.

func (*JqState) SetLibraryPath

func (jq *JqState) SetLibraryPath(path string)

func (*JqState) Teardown

func (jq *JqState) Teardown()

Jump to

Keyboard shortcuts

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