fsm

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: BSD-3-Clause Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(event EventDesc)

type EventDesc

type EventDesc struct {
	Name string
	Src  string
	Dst  string
	Args []interface{}
}

type FSM

type FSM struct {
	// contains filtered or unexported fields
}

func NewFSM

func NewFSM(initia string, rules []Rule) *FSM

func (*FSM) Current

func (f *FSM) Current() string

func (*FSM) Event

func (f *FSM) Event(event string, args ...interface{}) (err error)

func (*FSM) SetCallback

func (f *FSM) SetCallback(state string, cb Callback)

type Rule

type Rule struct {
	Name string
	Src  []string
	Dst  string
}

Jump to

Keyboard shortcuts

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