expr

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package expr evaluates the expressions and {{ }} templates of a workflow.

Index

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) Eval

func (e *Expr) Eval(input string, env any) (any, error)

func (*Expr) EvalOrEvalTemplate

func (e *Expr) EvalOrEvalTemplate(input string, env any) (string, error)

func (*Expr) EvalTemplate

func (e *Expr) EvalTemplate(input string, env any) (string, error)

func (*Expr) EvalTemplateMap

func (e *Expr) EvalTemplateMap(input map[string]any, env any) map[string]any

func (*Expr) EvalTemplateWithTypePreservation

func (e *Expr) EvalTemplateWithTypePreservation(input string, env any) (any, error)

func (*Expr) Options

func (e *Expr) Options(env any) []ex.Option

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.

Jump to

Keyboard shortcuts

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