Documentation
¶
Overview ¶
Package expression evaluates CEL expressions in decoded configuration values.
Index ¶
- Variables
- func Check(value any, allowedRoots ...string) error
- func Env() map[string]any
- func Environment(value any) (map[string]string, error)
- func Eval(value any, contexts map[string]any) (any, error)
- func Has(value any) bool
- func Roots(value any) ([]string, error)
- func Uses(value any, root, field string) ([]string, bool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrMissingReference = errors.New("required reference is missing")
ErrMissingReference identifies an absent expression key or attribute.
Functions ¶
func Check ¶
Check validates expressions without reading their context values. Only the named context roots are allowed; passing no roots permits literal expressions.
func Environment ¶
Environment captures only environment keys referenced by expressions. Missing keys remain absent so optional lookups can use their fallback. Dynamic key access, or use of the whole env object, conservatively captures all keys.
func Eval ¶
Eval resolves templates once, without changing value or contexts. Whole-value expressions retain their native type; expressions within text must be scalars. Contexts contain only data, with environment values represented as strings.
func Has ¶
Has reports whether a value contains an unescaped expression opener. Malformed expressions also return true so they can be rejected by Check.
Types ¶
This section is empty.