Documentation ¶
Index ¶
- type Action
- type StateMachine
- func (m *StateMachine) Event(ctx context.Context, currentState, event string, args ...interface{}) error
- func (m *StateMachine) ExportJPG(outfile string) error
- func (m *StateMachine) ExportPNG(outfile string) error
- func (m *StateMachine) ExportWithDetails(outfile string, format string, layout string, scale string, more string) error
- func (m *StateMachine) WithTransition(transition Transition) *StateMachine
- func (m *StateMachine) WithTransitionListener(l TransitionListener) *StateMachine
- func (m *StateMachine) WithTransitions(transitions []Transition) *StateMachine
- type StatemError
- type Transition
- type TransitionListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
StateMachine ....
func (*StateMachine) Event ¶
func (m *StateMachine) Event(ctx context.Context, currentState, event string, args ...interface{}) error
Event ....
func (*StateMachine) ExportJPG ¶
func (m *StateMachine) ExportJPG(outfile string) error
ExportJPG ....
func (*StateMachine) ExportPNG ¶
func (m *StateMachine) ExportPNG(outfile string) error
ExportPNG 导出状态图
func (*StateMachine) ExportWithDetails ¶
func (m *StateMachine) ExportWithDetails(outfile string, format string, layout string, scale string, more string) error
ExportWithDetails 导出状态图
func (*StateMachine) WithTransition ¶
func (m *StateMachine) WithTransition(transition Transition) *StateMachine
WithTransition ....
func (*StateMachine) WithTransitionListener ¶
func (m *StateMachine) WithTransitionListener(l TransitionListener) *StateMachine
WithTransitionListener ....
func (*StateMachine) WithTransitions ¶
func (m *StateMachine) WithTransitions(transitions []Transition) *StateMachine
WithTransitions ....
type StatemError ¶
StatemError ....
func (*StatemError) Error ¶
func (e *StatemError) Error() string
type Transition ¶
Transition ....
type TransitionListener ¶
type TransitionListener interface { OnStateEnter(ctx context.Context, event, toState string, args ...interface{}) error OnAction(ctx context.Context, fromState, event string, action Action, toState string, args ...interface{}) error OnStateExit(ctx context.Context, fromState, event string, args ...interface{}) error }
TransitionListener ....
Click to show internal directories.
Click to hide internal directories.