Documentation
¶
Index ¶
- func GenerateVisualization(fsm FSM, newFilePath string)
- type FSM
- func ClearHistory(fsm FSM) FSM
- func Execute(fsm FSM, transition string) FSM
- func Generate(initialState string, flags ...bool) FSM
- func HistoryBack(fsm FSM, numSteps int) FSM
- func HistoryForward(fsm FSM, numSteps int) FSM
- func LimitHistory(fsm FSM, limit int) FSM
- func SetCallbacks(fsm FSM, newOnBeforeTransition onBeforeTransitionCallback, ...) FSM
- func SetTransitions(fsm FSM, newTransitions []Transition) FSM
- type State
- type Transition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateVisualization ¶
generates a visualization of FSM
Types ¶
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
definition of an FSM
func Generate ¶
returns a new generated FSM with given name of initial state and given flags first flag is a boolean that indicates whether or not state history should be tracked
func HistoryBack ¶
returns new FSM with state stepped back given number of times
func HistoryForward ¶
returns new FSM with state stepped forwards given number of times
func LimitHistory ¶
returns new FSM with state history limited to the last given number of states
func SetCallbacks ¶
func SetCallbacks(fsm FSM, newOnBeforeTransition onBeforeTransitionCallback, newOnAfterTransition onAfterTransitionCallback, newOnEnterState onEnterStateCallback, newOnLeaveState onLeaveStateCallback) FSM
returns new FSM with given callback functions
func SetTransitions ¶
func SetTransitions(fsm FSM, newTransitions []Transition) FSM
returns a new FSM with given list of transitions
func (*FSM) AllTransitions ¶
returns a list of names of all transitions that can be made from all states of FSM
func (*FSM) ValidTransitions ¶
returns a list of names of valid transitions that can be made from current state of FSM
type Transition ¶
type Transition struct {
// contains filtered or unexported fields
}
definition of a Transition