Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultProcessor = NewProcessor()
var ErrEntryAlreadyRegistered = errors.New("function already registered")
var Unmarshal = DefaultProcessor.Unmarshal
Functions ¶
Types ¶
type ExprEntry ¶
ExprEntry is a type alias for a function. The function receives a Context and returns should return a func() that receives and return any number of params.
type Processor ¶
type Processor struct {
Env ExprEnv
}
Processor is a struct that holds lexer and parser functions.
func (*Processor) ParseBytes ¶
func (*Processor) Unmarshal ¶
Unmarshal will unmarshal the given data into the given interface. It will use the ParseBytes method to parse the data with the expressions and then unmarshal the parsed data into the given interface.
This methods resource wasteful as it will parse the data twice, once to resolve the expressions (In the future releaseWe could try to parse the data directly from the AST built from the ParseBytes).
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a scanner for YAML. It is a wrapper around the scanner.Scanner of the goccy/go-yaml library adding the ability to scan expressions inside the YAML string values.
This Scanner uses the Processor LexerFunctions as the expr.Run env.