Documentation
¶
Overview ¶
Package eval evaluates cirql expressions against an environment: the current object (for field access), the variable bindings (for $var), and an injected clock (for now()). Field access propagates null and arithmetic follows jq's double model; division or modulo by zero yields null.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Obj value.Value
Vars map[string]value.Value
Now func() int64 // epoch seconds; nil falls back to a zero clock
}
Env is the evaluation context for one expression.
type Error ¶
Error is the sentinel-error type for the eval package — an alias of errs.Const from github.com/gomatic/go-error, which owns the mechanism (Error, With). The alias keeps every existing `eval.Error` reference and errors.Is match compiling and behaving identically.
const ( // ErrUnknownFunc is returned when a called builtin does not exist. ErrUnknownFunc Error = "eval: unknown function" // ErrArity is returned when a builtin gets the wrong number of arguments. ErrArity Error = "eval: wrong argument count" // ErrType is returned when an operation gets an unsupported value type. ErrType Error = "eval: type error" // ErrNilExpr is returned when Eval is handed a nil expression — a pipeline // assembled programmatically with a missing Cond/Key/Expr, which the parser // never produces. ErrNilExpr Error = "eval: nil expression" )
Click to show internal directories.
Click to hide internal directories.