Documentation
¶
Overview ¶
Package fsm contains tools for implementing simple state machines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action describes the action taken by a state.
func EnterState ¶
EnterState returns an action that transitions to a new state.
func StayInCurrentState ¶
func StayInCurrentState() Action
StayInCurrentState is an action that stays in the current state.
type Binding ¶
Binding returns actions that can be performed by the state machine within the context of some additional arguments.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option is an option that changes the behavior of a state machine.
func WithFinalState ¶
WithFinalState is an option that sets the final state of a state machine.
The final state is entered whenever the state machine stops. It may be used to prevent the state machine from stopping (by explicitly entering another state) and/or to perform cleanup actions.