flow

package
v0.1.0-dev.20260217020211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(reg *execution.ActionRegistry)

Register registers all flow actions into the given registry.

Types

type Choose

type Choose struct{}

Choose is a predicate-driven branch selector. It evaluates case predicates against an input value and executes the first matching phase.

Slots:

  • input: any — the value to evaluate predicates against
  • cases: []execution.ChooseCase — predicate+phase pairs, evaluated in order
  • default: string — phase ID to execute when no predicate matches (optional)

Result: the selected branch phase's terminal node Result. UndoState: *ChooseUndoState — the branch's recovery entries.

func (*Choose) Do

Do evaluates predicates and executes the matching branch phase.

func (*Choose) Name

func (a *Choose) Name() string

Name returns the dotted action name.

func (*Choose) Undo

func (a *Choose) Undo(ctx *execution.Context, _ map[string]any, state execution.UndoState) error

Undo walks the selected branch's entries in reverse and calls Action.Undo.

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.

func (*Elevate) Do

Do acquires elevated privilege. Stub implementation — full sudo/privilege integration is a separate plan.

func (*Elevate) Name

func (a *Elevate) Name() string

Name returns the dotted action name.

func (*Elevate) Undo

func (a *Elevate) Undo(_ *execution.Context, _ map[string]any, _ execution.UndoState) error

Undo releases elevated privilege.

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. UndoState: *GatherUndoState — per-iteration entries for rollback.

func (*Gather) Do

Do executes the referenced phase once per item, with per-iteration isolation.

func (*Gather) Name

func (a *Gather) Name() string

Name returns the dotted action name.

func (*Gather) Undo

func (a *Gather) Undo(ctx *execution.Context, _ map[string]any, state execution.UndoState) error

Undo walks iterations in reverse, re-resolves slots with saved proxy context, and calls Action.Undo per entry.

type WaitUntil

type WaitUntil struct{}

WaitUntil is an event-driven sensor — a synchronization primitive that pauses execution until a predicate is satisfied or a timeout expires.

Slots:

  • target: any — the value to evaluate the predicate against (typically a promise)
  • predicate: execution.Predicate — 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. UndoState: nil — WaitUntil observes state but does not modify it.

func (*WaitUntil) Do

Do polls the predicate at the configured interval until it returns true or the timeout expires.

func (*WaitUntil) Name

func (a *WaitUntil) Name() string

Name returns the dotted action name.

func (*WaitUntil) Undo

func (a *WaitUntil) Undo(_ *execution.Context, _ map[string]any, _ execution.UndoState) error

Undo is a no-op — WaitUntil observes state but does not modify it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL