Documentation
¶
Overview ¶
Package expr compiles and evaluates the predicates of intent and workflow manifests: CEL expressions (cel-go) over typed facts, checked at load.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Closest ¶ added in v0.2.0
Closest is the option a typo of s plausibly meant, "" when none is that close: the same word in another case, or one at most max(1, len(s)/4) edits away, a swap of two neighbors counting as one. A tie is no suggestion, since either guess may be wrong.
func CompileWorkflow ¶
CompileWorkflow compiles a workflow's `when` over env (one unit slot, trigger.* and config.*) plus now, the evaluation's time.
func DidYouMean ¶ added in v0.2.0
DidYouMean is "; did you mean \"x\"?" for Closest's x, "" when none.
Types ¶
type Env ¶
type Error ¶
type Facts ¶
Facts resolves a dotted field; the value's Go type matches the Env (bool, int, string, []string, time.Duration, time.Time).
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func Compile ¶
Compile type-checks src against env; it returns an *Error on failure, and an empty or blank src is an error.
func (*Program) Eval ¶
Eval evaluates the predicate; a nil fact reads as its type's zero value and a runtime error, such as a fact of another Go type, reads as false.