jqer

package
v0.0.0-...-7240e86 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeJQBadQuery  = "eventmesh.workflow.jq.badCommand"
	ErrCodeJQNotObject = "eventmesh.workflow.jq.notObject"
)

Functions

func NewError

func NewError(code string, msg string, a ...interface{}) error

NewError error constructor

Types

type JQ

type JQ interface {
	Object(input interface{}, command interface{}) (map[string]interface{}, error)
	One(input interface{}, command interface{}) (interface{}, error)
}

JQ json query encapsulation

func NewJQ

func NewJQ(options ...Option) JQ

NewJQ constructor jq instance

type Option

type Option func(opts *Options)

Option represents the optional function.

func WithWrapBegin

func WithWrapBegin(wrapBegin string) Option

WithWrapBegin config wrap begin option

func WithWrapLeftSeparator

func WithWrapLeftSeparator(wrapBegin string) Option

WithWrapLeftSeparator config wrap left separator option

func WithWrapRightSeparator

func WithWrapRightSeparator(wrapBegin string) Option

WithWrapRightSeparator config wrap right separator option

type Options

type Options struct {
	WrapBegin          string
	WrapLeftSeparator  string
	WrapRightSeparator string
}

Options config option

Jump to

Keyboard shortcuts

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