sdkfsm

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyStates     = sdk.Errorf("brock/fsm: empty states")
	ErrNoInitialStates = sdk.Errorf("brock/fsm: no initial states")
)

Functions

This section is empty.

Types

type FSM

type FSM interface {
	CurrentState() string
	Next(action string) (next string, ok bool)
}

func New

func New(init string, fn OnTransition, tx TransitionTable) (FSM, error)

type OnTransition

type OnTransition func(state, action, nextState string)

type TransitionTable

type TransitionTable map[string]map[string]string

Jump to

Keyboard shortcuts

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