Versions in this module Expand all Collapse all v0 v0.0.2 Jun 16, 2016 Changes in this version + const Version + type CallbackHandler interface + StateTransitionCallback func(State) error + type Error struct + func (e *Error) Code() ErrorCode + func (e *Error) Error() string + func (e *Error) Message() string + type ErrorCode uint + const ErrorMachineNotInitialized + const ErrorStateUndefined + const ErrorTransitionNotPermitted + const ErrorUnknown + func (e ErrorCode) String() string + type Machine struct + func (m *Machine) AddStateTransitionRules(sourceState State, destinationStates ...State) error + func (m *Machine) CurrentState() State + func (m *Machine) SetStateTransitionCallback(callback CallbackHandler, synchronous bool) error + func (m *Machine) StateTransition(toState State) error + func (m *Machine) StateTransitionRules(state State) (TransitionRuleSet, error) + type State string + type TransitionRuleSet map[State]struct + func (trs TransitionRuleSet) Copy() TransitionRuleSet