fsm

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(form, to State, args ...interface{}) error

type Event

type Event string

type FSM

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

func NewFSM

func NewFSM(transitions ...Transition) *FSM

func (*FSM) Trigger

func (f *FSM) Trigger(currentState State, event Event, args ...interface{}) error

type State

type State uint8

type Transition

type Transition struct {
	From   State
	To     State
	Event  Event
	Action Action
}

Jump to

Keyboard shortcuts

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