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 ¶
type Error string
Error is the sentinel error type for the eval package.
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" )
Click to show internal directories.
Click to hide internal directories.