Documentation
¶
Overview ¶
Package exprenv builds and evaluates expr-lang environments for spec expressions.
Index ¶
- func BaseFuncs(ptyEnabled bool) map[string]any
- func EvalExpr(env map[string]any, s string) string
- func EvalExprAny(env map[string]any, s string) (any, bool)
- func EvalItemsExpr(env map[string]any, s string) ([]any, error)
- func Make(ctx *cmdctx.Ctx) map[string]any
- func ResolvePath(env map[string]any, path string) (string, error)
- func WithIt(env map[string]any, val any) map[string]any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseFuncs ¶
BaseFuncs returns the ctx-independent functions injected into every expr-lang environment. ptyEnabled gates the PTY-sensitive rendering functions (pipelineSparkline, statusIcon, prLabelColor).
func EvalExpr ¶
EvalExpr evaluates s as an expr-lang expression, returning the result as a string. Returns "" when the expression fails or produces a nil/empty result.
func EvalExprAny ¶
EvalExprAny evaluates s as an expr-lang expression and returns the raw result. The bool is false when the expression fails or the result is nil.
func EvalItemsExpr ¶
EvalItemsExpr evaluates s as an expr-lang expression expected to return a []any.
func Make ¶
Make builds the expr-lang environment from ctx. Flags are exposed as a flat map under "flags".
func ResolvePath ¶
ResolvePath evaluates all {{expr}} segments in a path template using the given expr environment, replacing each with its string result.
Types ¶
This section is empty.