Documentation ¶
Overview ¶
A state machine - not ready yet.
Index ¶
- Constants
- func StatePath(state State) string
- type BaseState
- type Persistence
- type State
- type StateMachine
- func (self *StateMachine) CurrentState() State
- func (self *StateMachine) Enter(transition *Transition)
- func (self *StateMachine) Event(event string)
- func (self *StateMachine) Leave(transition *Transition)
- func (self *StateMachine) Name() string
- func (self *StateMachine) SetStateMachine(parent *StateMachine)
- func (self *StateMachine) StateMachine() *StateMachine
- type Transition
- type TransitionVetoer
Constants ¶
View Source
const ( Transient = iota SessionPersistent UserPersistent )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseState ¶
type BaseState struct {
// contains filtered or unexported fields
}
func (*BaseState) Enter ¶
func (self *BaseState) Enter(*Transition)
func (*BaseState) Leave ¶
func (self *BaseState) Leave(*Transition)
func (*BaseState) SetStateMachine ¶
func (self *BaseState) SetStateMachine(parent *StateMachine)
func (*BaseState) StateMachine ¶
func (self *BaseState) StateMachine() *StateMachine
type Persistence ¶
type Persistence uint
type State ¶
type State interface { SetStateMachine(*StateMachine) StateMachine() *StateMachine Name() string Enter(*Transition) Leave(*Transition) }
type StateMachine ¶
type StateMachine struct { States []State Transitions []*Transition // contains filtered or unexported fields }
func (*StateMachine) CurrentState ¶
func (self *StateMachine) CurrentState() State
func (*StateMachine) Enter ¶
func (self *StateMachine) Enter(transition *Transition)
func (*StateMachine) Event ¶
func (self *StateMachine) Event(event string)
func (*StateMachine) Leave ¶
func (self *StateMachine) Leave(transition *Transition)
func (*StateMachine) Name ¶
func (self *StateMachine) Name() string
func (*StateMachine) SetStateMachine ¶
func (self *StateMachine) SetStateMachine(parent *StateMachine)
func (*StateMachine) StateMachine ¶
func (self *StateMachine) StateMachine() *StateMachine
type Transition ¶
func (*Transition) Do ¶
func (self *Transition) Do()
func (*Transition) Veto ¶
func (self *Transition) Veto() bool
type TransitionVetoer ¶
type TransitionVetoer interface {
TransitionVeto(*Transition) bool
}
Click to show internal directories.
Click to hide internal directories.