Documentation
¶
Overview ¶
Package assert evaluates declared assertions against a value. It is shared: the engine runs it as a post-step for provider nodes, and looping nodes (poll, sse) call it per attempt/event. It is a plain package function, not a method on a context — the way json.Marshal is.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Op ¶
type Op string
Op is a comparison operator.
const ( OpEquals Op = "equals" OpNotEquals Op = "not_equals" OpContains Op = "contains" OpNotContains Op = "not_contains" OpStartsWith Op = "starts_with" OpEndsWith Op = "ends_with" OpRegex Op = "regex" OpEmpty Op = "empty" OpNotEmpty Op = "not_empty" OpGreaterThan Op = "gt" OpLessThan Op = "lt" OpGTE Op = "gte" OpLTE Op = "lte" OpBetween Op = "between" OpExists Op = "exists" )
Built-in operators.
type Results ¶
type Results []Result
Results is the outcome of evaluating a set of specs.
type Spec ¶
type Spec struct {
Path string `json:"path"`
Op Op `json:"op"`
Expected value.Value `json:"expected"`
}
Spec is one declared assertion: extract Path from the value, compare it with Op against Expected. Expected is boxed at decode, so re-evaluating the same spec (poll attempts, SSE events, loop iterations) never re-parses it.
Click to show internal directories.
Click to hide internal directories.