Documentation
¶
Index ¶
- Variables
- type Engine
- func (e *Engine) ApplyEvent(ctx context.Context, req interfaces.ApplyEventRequest) (*interfaces.ApplyEventResponse, error)
- func (e *Engine) RegisterAction(name string, action interfaces.Action) error
- func (e *Engine) RegisterDynamicTarget(name string, resolver interfaces.DynamicTargetResolver) error
- func (e *Engine) RegisterGuard(name string, guard interfaces.Guard) error
- func (e *Engine) RegisterMachine(_ context.Context, definition interfaces.MachineDefinition) error
- func (e *Engine) Snapshot(ctx context.Context, req interfaces.SnapshotRequest) (*interfaces.Snapshot, error)
- type Option
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 (*Engine) ApplyEvent ¶ added in v0.37.0
func (e *Engine) ApplyEvent(ctx context.Context, req interfaces.ApplyEventRequest) (*interfaces.ApplyEventResponse, error)
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
func (e *Engine) Snapshot(ctx context.Context, req interfaces.SnapshotRequest) (*interfaces.Snapshot, error)
Snapshot computes transition availability for the current machine/entity state.
Click to show internal directories.
Click to hide internal directories.