Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChangeState = errors.New("change state error")
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶ added in v0.0.5
type Option ¶ added in v0.0.5
type Option func(*StateMachine)
func WithErrorHandler ¶ added in v0.0.5
func WithErrorHandler(handler ErrorHandler) Option
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
StateMachine 无限状态机
func NewStateMachine ¶
func NewStateMachine(options ...Option) *StateMachine
func (*StateMachine) ChangeState ¶
func (x *StateMachine) ChangeState(from, to uint) error
func (*StateMachine) Register ¶
func (x *StateMachine) Register(from, to *StateNode) error
Click to show internal directories.
Click to hide internal directories.