statem

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionFunc

type ActionFunc = func(ctx context.Context, from, event string, action string, to string, args ...interface{}) error

ActionFunc ....

type FSM

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

FSM ....

func New

func New(poolSize int) *FSM

New ....

func (*FSM) Event

func (m *FSM) Event(ctx context.Context, currentState, ev string, args ...interface{}) error

Event ....

func (*FSM) ExportJPG

func (m *FSM) ExportJPG(outfile string) error

ExportJPG ....

func (*FSM) ExportPNG

func (m *FSM) ExportPNG(outfile string) error

ExportPNG 导出状态图

func (*FSM) ExportWithDetails

func (m *FSM) ExportWithDetails(outfile string, format string, layout string, scale string, more string) error

ExportWithDetails 导出状态图

func (*FSM) WithActionFunc added in v1.1.5

func (m *FSM) WithActionFunc(action string, f ActionFunc) *FSM

WithActionFunc ....

func (*FSM) WithActionFuncs added in v1.2.7

func (m *FSM) WithActionFuncs(actions map[string]ActionFunc) *FSM

WithActionFuncs ....

func (*FSM) WithStateEnterFunc

func (m *FSM) WithStateEnterFunc(f StateEnterFunc) *FSM

WithStateEnterFunc ....

func (*FSM) WithStateExitFunc

func (m *FSM) WithStateExitFunc(f StateExitFunc) *FSM

WithStateExitFunc ....

func (*FSM) WithTransition

func (m *FSM) WithTransition(from, event, to string, f ...ActionFunc) *FSM

WithTransition ....

func (*FSM) WithTransitionActionName added in v1.1.5

func (m *FSM) WithTransitionActionName(from, event, to string, action ...string) *FSM

WithTransitionActionName ....

func (*FSM) WithTransitionFromFile added in v1.1.5

func (m *FSM) WithTransitionFromFile(file string) *FSM

WithTransitionFromFile ....

func (*FSM) WithTransitionFromJSON added in v1.1.5

func (m *FSM) WithTransitionFromJSON(b []byte) *FSM

WithTransitionFromJSON ....

type StateEnterFunc

type StateEnterFunc = func(ctx context.Context, event, to string, args ...interface{}) error

StateEnterFunc ....

type StateError

type StateError struct {
	BadEvent     string
	CurrentState string
	Args         []interface{}
}

StateError ....

func (*StateError) Error

func (e *StateError) Error() string

type StateExitFunc

type StateExitFunc = func(ctx context.Context, from, event string, args ...interface{}) error

StateExitFunc ....

Jump to

Keyboard shortcuts

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