Versions in this module Expand all Collapse all v0 v0.3.1 Oct 29, 2026 v0.3.0 Oct 29, 2026 v0.2.1 Oct 28, 2026 v0.2.0 Oct 28, 2026 v0.1.0 Oct 28, 2026 Changes in this version + const DefaultCostLimit + const DefaultInterruptCheckFrequency + const DefaultTimeout + const EstimateSizeHint + const ExprPrefix + const VarActor + const VarApproval + const VarEvent + const VarInputs + const VarItem + const VarNow + const VarParams + const VarProvider + const VarRun + const VarTask + var ErrCostLimit = errors.New("cost limit exceeded") + var ErrInterpolate = errors.New("param cannot be interpolated into a string") + var ErrMissing = errors.New("missing key or attribute") + var ErrNotCompiled = errors.New("expression not compiled") + var ErrParamType = errors.New("substituted value has the wrong type") + var ErrPlaceholder = errors.New("invalid placeholder") + var ErrTimeout = errors.New("evaluation timeout") + var ErrType = errors.New("wrong type") + var ErrUnknownParam = errors.New("unknown param") + func CELSource(s string) (src string, ok bool) + func EvalTree(ctx context.Context, v any, a Activation, progs ProgramIndex) (any, error) + func MergeParams(declared, defaults, overrides map[string]any) (map[string]any, error) + func Substitute(v any, params map[string]any) (any, error) + func SubstituteRule(r *v1alpha1.Rule, params map[string]any) (*v1alpha1.Rule, error) + func Unescape(s string) string + type Activation struct + Actor map[string]any + Approval map[string]any + Event map[string]any + Inputs map[string]any + Item map[string]any + Now time.Time + Params map[string]any + Provider map[string]any + Run map[string]any + Task map[string]any + type Code string + const CodeCanceled + const CodeCheck + const CodeEval + const CodeLimit + const CodeParse + type CompileError struct + Code Code + Expr string + Issues []Issue + Path string + func (e *CompileError) Error() string + type Env struct + func NewEnv(opts ...Option) (*Env, error) + func (e *Env) Compile(src string, kind ExprKind) (*Program, error) + func (e *Env) CompileTree(v any, idx ProgramIndex) error + type EvalError struct + Code Code + Column int + Err error + Expr string + Line int + Message string + Path string + func (e *EvalError) Error() string + func (e *EvalError) Unwrap() error + type ExprKind int + const Value + const Where + func (k ExprKind) String() string + type FieldError struct + Column int + Expr string + Field string + Line int + func (e *FieldError) Error() string + type Issue struct + Column int + Line int + Message string + func (i Issue) String() string + type Option func(*options) + func WithCostLimit(n uint64) Option + func WithInterruptCheckFrequency(n uint) Option + func WithTimeout(d time.Duration) Option + type ParamError struct + Err error + Message string + Param string + Path string + func (e *ParamError) Error() string + func (e *ParamError) Unwrap() error + type Program struct + func (p *Program) EstimateCost() (minCost, maxCost uint64, err error) + func (p *Program) EvalBool(ctx context.Context, a Activation) (bool, error) + func (p *Program) EvalValue(ctx context.Context, a Activation) (any, error) + func (p *Program) Kind() ExprKind + func (p *Program) Source() string + func (p *Program) UnknownFields() []*FieldError + func (p *Program) Variables() []string + type ProgramIndex map[string]*Program