statemachine

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 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 StateFunction

type StateFunction func(sm *StateMachine) error

type StateMachine

type StateMachine struct {
	Data any

	Config  *config.Config
	CliMode bool
	// contains filtered or unexported fields
}

func NewStateMachine

func NewStateMachine(stateCount int) *StateMachine

func (*StateMachine) AddState

func (sm *StateMachine) AddState(id int, fn StateFunction)

func (*StateMachine) SetState

func (sm *StateMachine) SetState(state int)

func (*StateMachine) Step

func (sm *StateMachine) Step() error

Jump to

Keyboard shortcuts

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