Documentation
¶
Index ¶
- type Config
- type Evaluator
- func (e *Evaluator) Close()
- func (e *Evaluator) EvaluateCondition(ctx context.Context, expr string, vars map[string]any) (bool, error)
- func (e *Evaluator) EvaluateExpression(ctx context.Context, expr string, vars map[string]any) (any, error)
- func (e *Evaluator) ResolveTemplate(ctx context.Context, template any, vars map[string]any) (any, error)
- type Expression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config = templating.Config
Config aliases the core templating config for SDK evaluators.
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator wraps core templating to evaluate expressions inside engrams.
func NewEvaluator ¶
NewEvaluator creates a template evaluator using core templating.
func (*Evaluator) EvaluateCondition ¶
func (e *Evaluator) EvaluateCondition(ctx context.Context, expr string, vars map[string]any) (bool, error)
EvaluateCondition evaluates a boolean template expression. Returns true if the expression resolves to a truthy value. An empty expression returns true (no filter = pass all).
type Expression ¶
type Expression struct {
// Expr is the CEL source expression to evaluate.
Expr string
// Vars contains the variable bindings available to Expr at evaluation time.
Vars map[string]any
}
Expression holds a CEL expression and its variable bindings.
func ExtractExpression ¶
func ExtractExpression(value any) (Expression, bool)
ExtractExpression extracts a template expression wrapper from a map.
Click to show internal directories.
Click to hide internal directories.