expression

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalExpression

func EvalExpression(expr *Expression, msg protoreflect.Message) (result string, err error)

EvalExpression evaluates an expression against a proto message

func MustParseMapping added in v1.0.0

func MustParseMapping(input string) *bloblang.Executor

MustParseMapping attempts to parse a bloblang mapping and panics on error

func ToStructured added in v1.0.0

func ToStructured(msg protoreflect.Message) (any, error)

ToStructured marshals a proto message into a map[string]any value

Types

type Expression

type Expression struct {
	Fragments []*Fragment `parser:"@@*"`
	// contains filtered or unexported fields
}

Declare simple grammer for bloblang expressions

func Lex added in v1.12.0

func Lex(input string) (*Expression, error)

func MustParseExpression

func MustParseExpression(input string) *Expression

MustParseExpression attempts to parse an Expression and panics on error

func ParseExpression

func ParseExpression(input string) (*Expression, error)

ParseExpression parses an Expression value from the provided string

type Fragment

type Fragment struct {
	Ident string `parser:"( @String"`
	Expr  *Query `parser:"  | '${!' @@ '}' )"`
}

Declare simple grammer for bloblang expressions

type Query

type Query struct {
	Mapping string `parser:"@Mapping"`
	// contains filtered or unexported fields
}

Declare simple grammer for bloblang expressions

Jump to

Keyboard shortcuts

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