Documentation
¶
Overview ¶
Package rules compiles and evaluates the boolean expressions used by choice nodes. Expressions are written in expr-lang and evaluated against the shared execution payload, exposed as the variable `payload`.
when: "payload.risk_score > 80"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is a compiled choice expression.
func (*Program) Match ¶
func (p *Program) Match(payload json.RawMessage) (bool, error)
Match evaluates the program against the JSON payload. A nil/zero result and a non-nil error are returned when evaluation fails (e.g. a referenced field is missing); callers typically treat that as "no match" and fall through to the default rule.
Click to show internal directories.
Click to hide internal directories.