Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSubjectCannotBeNil occurs when subject is nil. ErrSubjectCannotBeNil = errors.New(`subject cannot be nil`) // ErrInvalidGroup occurs when a group does not exist. ErrInvalidGroup = errors.New(`invalid group`) // ErrInvalidFromState occurs when a from state does not exist. ErrInvalidFromState = errors.New(`"from" state is invalid`) // ErrInvalidToState occurs when a to state does not exist. ErrInvalidToState = errors.New(`"to" state is invalid`) )
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition func() error
Condition must be checked before transitioning. Can also be used as a callback.
type StateMachine ¶
StateMachine wraps the paths and has a reference to that which we are managing state for.
func (*StateMachine) Transition ¶
func (sm *StateMachine) Transition(in Group, to State) error
Transition validates state transitions.
Click to show internal directories.
Click to hide internal directories.