simple

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMachineIDRequired indicates a workflow machine identifier is missing.
	ErrMachineIDRequired = stdErrors.New("workflow: machine id required")
	// ErrMachineNotRegistered indicates no workflow machine exists for the requested id.
	ErrMachineNotRegistered = stdErrors.New("workflow: machine not registered")
)

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is a deterministic in-memory workflow engine aligned to flow envelopes.

func New

func New(opts ...Option) *Engine

New constructs a workflow engine seeded with the default page machine.

func (*Engine) ApplyEvent added in v0.37.0

ApplyEvent applies one canonical event envelope against the target machine.

func (*Engine) RegisterAction added in v0.37.0

func (e *Engine) RegisterAction(name string, action interfaces.Action) error

RegisterAction stores a named action in the registry.

func (*Engine) RegisterDynamicTarget added in v0.37.0

func (e *Engine) RegisterDynamicTarget(name string, resolver interfaces.DynamicTargetResolver) error

RegisterDynamicTarget stores a named dynamic target resolver.

func (*Engine) RegisterGuard added in v0.37.0

func (e *Engine) RegisterGuard(name string, guard interfaces.Guard) error

RegisterGuard stores a named guard in the resolver registry.

func (*Engine) RegisterMachine added in v0.37.0

func (e *Engine) RegisterMachine(_ context.Context, definition interfaces.MachineDefinition) error

RegisterMachine installs or replaces a machine definition.

func (*Engine) Snapshot added in v0.37.0

Snapshot computes transition availability for the current machine/entity state.

type Option

type Option func(*Engine)

Option configures the engine.

func WithClock

func WithClock(clock func() time.Time) Option

WithClock overrides the clock used for deterministic test assertions.

Jump to

Keyboard shortcuts

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