Documentation ¶
Index ¶
- Variables
- type Fsm
- type FsmState
- type Managed
- type ManagedSet
- type MinHeap
- func (h *MinHeap) Add(c Managed) *Fsm
- func (h *MinHeap) Instances(groupBy interface{}) []*Fsm
- func (h *MinHeap) Len() int
- func (h *MinHeap) Less(i, j int) bool
- func (h *MinHeap) Pop() interface{}
- func (h *MinHeap) Push(x interface{})
- func (h *MinHeap) Remove(c Managed)
- func (h *MinHeap) Swap(i, j int)
- func (h *MinHeap) Visit(visit func(ManagedSet))
- type State
- type StateTransitions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Fsm ¶
type Fsm struct { Definition StateTransitions CustomData interface{} `json:"custom_data,omitempty"` History []*FsmState `json:"history"` Expiration <-chan *FsmState `json:"-"` Complete <-chan *FsmState `json:"-"` // contains filtered or unexported fields }
func NewFsm ¶
func NewFsm(def StateTransitions, initial State) *Fsm
type FsmState ¶
type FsmState struct { Id int `json:"id"` State State `json:"state"` Started time.Time `json:"started"` Expiry time.Time `json:"expiry"` Message string `json:"message"` Error error `json:"error"` // contains filtered or unexported fields }
func (*FsmState) SetDeadline ¶
Sets the start time and the expiry. This also starts a timer
type Managed ¶
type Managed interface {
GetKey() interface{}
}
For something to be managed, it has to have a key or indexable attribute.
type ManagedSet ¶
type ManagedSet interface { Managed Add(Managed) *Fsm Remove(Managed) Instances() []*Fsm Empty() bool }
Managed set of objects by some common criteria / key
type MinHeap ¶
type MinHeap struct { EqualFunc func(a, b interface{}) bool LessFunc func(a, b interface{}) bool NewFunc func(interface{}) ManagedSet // contains filtered or unexported fields }
Min-heap of container groups prioritized by the version
func (*MinHeap) Visit ¶
func (h *MinHeap) Visit(visit func(ManagedSet))
type StateTransitions ¶
Click to show internal directories.
Click to hide internal directories.