Documentation
¶
Overview ¶
Package flow implements flow-control actions for execution graphs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Choose ¶
type Choose struct{}
Choose is a conditional branch selector. It reads a boolean from its "when" slot and executes either the "then" or "else" phase.
Slots:
- when: bool — condition (resolved from a predicate action's output)
- then: string — phase ID to execute when true
- else: string — phase ID to execute when false (optional)
Result: the selected branch phase's terminal node Result. Complement: *chooseComplement — the branch's recovery entries.
func (*Choose) Do ¶
func (a *Choose) Do(ctx *op.Context, slots map[string]any) (result op.Result, complement op.Complement, err error)
Do reads the boolean condition and executes the matching branch phase.
type Complete ¶
type Complete struct{}
Complete is the default, healthy conclusion of a graph path. Leaf node — nothing depends on it. Accepts an optional output value that can be captured by the graph consumer.
type Degraded ¶
type Degraded struct{}
Degraded is a terminal leaf node that marks a branch as non-optimal while allowing graph execution to continue. It formats a Go template message from its slots, writes to stderr, and returns the rendered warning as the node output.
type Elevate ¶
type Elevate struct{}
Elevate is a privilege transition flow action. It marks the boundary between unprivileged and privileged execution as an explicit graph node. In dry-run mode it reports "root required here"; the receipt records when privilege was acquired and released.
type Fatal ¶
type Fatal struct{}
Fatal is a terminal leaf node that halts graph execution immediately. Same signature as Degraded — a Go template format string with args/kwargs. The executor detects FatalError and stops.
type FlowPlan ¶
type FlowPlan struct {
// contains filtered or unexported fields
}
FlowPlan implements the plan.flow namespace for Starlark scripts. Handwritten — flow actions have custom signatures that don't fit the reflection-based WrapPlanned model.
func NewFlowPlan ¶
NewFlowPlan creates a plan.flow namespace bound to the given graph.
type Gather ¶
type Gather struct{}
Gather is a parallel comprehension flow action. It executes a phase body once per item with configurable concurrency, collecting terminal results.
Slots:
- items: []any — the list of items to iterate over
- do: string — phase ID of the body to execute per item
- limit: int — max concurrent iterations (default 1 = sequential)
Result: []any — terminal node Result from each iteration, in item order. Complement: *gatherComplement — per-iteration entries for rollback.
func (*Gather) Do ¶
func (a *Gather) Do(ctx *op.Context, slots map[string]any) (result op.Result, complement op.Complement, err error)
Do executes the referenced phase once per item, with per-iteration isolation.
type PredicateFunc ¶
PredicateFunc is a re-evaluable condition for polling actions.
type WaitUntil ¶
type WaitUntil struct{}
WaitUntil is an event-driven sensor — a synchronization primitive that pauses execution until a condition is satisfied or a timeout expires.
Slots:
- target: any — the value to evaluate the predicate against (typically a promise)
- predicate: PredicateFunc — condition to evaluate
- timeout: string — maximum wait time (Go duration, e.g. "5m")
- interval: string — poll interval (Go duration, default "5s")
Result: the target value when the predicate returns true.