Documentation
¶
Overview ¶
Package expr evaluates the expressions and {{ }} templates of a workflow.
Index ¶
- type Expr
- func (e *Expr) Eval(input string, env any) (any, error)
- func (e *Expr) EvalOrEvalTemplate(input string, env any) (string, error)
- func (e *Expr) EvalTemplate(input string, env any) (string, error)
- func (e *Expr) EvalTemplateMap(input map[string]any, env any) map[string]any
- func (e *Expr) EvalTemplateWithTypePreservation(input string, env any) (any, error)
- func (e *Expr) Options(env any) []ex.Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expr ¶
type Expr struct{}
Expr evaluates expressions and templates against an environment such as a step's context.
func (*Expr) EvalOrEvalTemplate ¶
func (*Expr) EvalTemplateMap ¶
func (*Expr) EvalTemplateWithTypePreservation ¶
func (*Expr) Options ¶
Options builds the expr options used to compile every workflow expression.
Two guards that used to live here have been removed because neither did anything. ex.DisableBuiltin had no effect on all / any / one / filter / map / count: expr's parser recognises those as predicate builtins before it looks at the disabled set (parser.go, the `predicates` table), so the calls were dead and the functions have always been reachable. A per-key blocklist that filtered the environment was equally inert, because the filtered copy only ever reached the type checker while ex.Run receives the caller's env, and enforcing it would have broken the documented way of reading credentials into `vars`.
What still bounds an expression is the length check in validateExpression, the evaluation timeout in executeWithTimeout, and the argument limits on the functions registered below.