Documentation
¶
Overview ¶
Package vareval evaluates the templates in vars, those of a workflow and those of a step. EvalValue evaluates one var, as a step evaluates each of its vars. Eval evaluates the vars of a workflow with it, each var after the vars it reads, so that a value such as random_str(8) is computed once, and reports a var that reads itself through others as a circular reference.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eval ¶
func Eval(written map[string]any, given map[string]string, env map[string]string) (map[string]any, error)
Eval evaluates the templates in the vars a workflow writes, with env, the environment variables, to read. A var can read another as vars.<name>; each one is evaluated after the vars it reads, so a value such as random_str(8) is computed once and every var that reads it sees the same value. A var whose template cannot be evaluated is an error, and so is a circular reference.
A var in given, which the person running the workflow gave, is not evaluated: it is the text given, whatever the workflow writes for it, and the vars that read it see that text. Neither written nor env is changed.
func EvalValue ¶
EvalValue evaluates the templates in the var name, a workflow var or a step var, with ev and env: a string becomes a string, and a map or a list keeps the type of each value that is a single template. Other values are kept as they are. An error names the value that could not be evaluated, as vars.auth.user.
Types ¶
This section is empty.