fsm

package
v0.0.0-...-98ba599 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fsm

type Fsm struct {
	Initial     interface{}
	Transitions map[interface{}][]Transition
}

Fsm is a read-only FSM definition

func New

func New(initial interface{}, transitions []Transition) *Fsm

func (*Fsm) FindTransition

func (f *Fsm) FindTransition(src, dst interface{}) *Transition

func (*Fsm) NewInstance

func (f *Fsm) NewInstance(overrideInitial ...interface{}) FsmInstance

func (*Fsm) NodeExists

func (f *Fsm) NodeExists(i interface{}) bool

type FsmInstance

type FsmInstance struct {
	*Fsm
	// contains filtered or unexported fields
}

func (*FsmInstance) CanTransitionTo

func (f *FsmInstance) CanTransitionTo(node interface{}) bool

func (*FsmInstance) Current

func (f *FsmInstance) Current() interface{}

func (*FsmInstance) Evaluate

func (f *FsmInstance) Evaluate(input interface{}) error

func (*FsmInstance) TransitionTo

func (f *FsmInstance) TransitionTo(node interface{}) error

type Transition

type Transition struct {
	Event interface{}
	Src   interface{}
	Dst   interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL