executor

package
v0.49.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoEnabledTransition        = errors.New("no enabled transition")
	ErrMultipleEnabledTransitions = errors.New("multiple enabled transitions")
)

Functions

This section is empty.

Types

type Action

type Action[V, E any] func(ctx context.Context, vars *V, env *E) error

type Executor

type Executor[V, E any] struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor[V, E any](transitions []Transition[V, E]) (*Executor[V, E], error)

func (*Executor[V, E]) Step

func (e *Executor[V, E]) Step(ctx context.Context, vars *V, current State) (next State, action Action[V, E], err error)

type Guard

type Guard[V any] func(vars *V) (enabled bool)

type State

type State string

type Transition

type Transition[V, E any] struct {
	Source State
	Target State
	Guard  Guard[V]
	Action Action[V, E]
}

Jump to

Keyboard shortcuts

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