fsm_pool

package
v0.0.0-...-ee95d54 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSMEventsMapper

type FSMEventsMapper map[fsm.Event]string

type FSMMapper

type FSMMapper map[string]MachineProvider

type FSMPool

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

func Init

func Init(machines ...MachineProvider) *FSMPool

func (*FSMPool) EntryPointMachine

func (p *FSMPool) EntryPointMachine() (MachineProvider, error)

func (*FSMPool) MachineByEvent

func (p *FSMPool) MachineByEvent(event fsm.Event) (MachineProvider, error)

func (*FSMPool) MachineByState

func (p *FSMPool) MachineByState(state fsm.State) (MachineProvider, error)

Out states now is not returns machine

type FSMStatesMapper

type FSMStatesMapper map[fsm.State]string

type MachineProvider

type MachineProvider interface {
	Name() string

	InitialState() fsm.State

	State() fsm.State

	// Process event
	Do(event fsm.Event, args ...interface{}) (*fsm.Response, error)

	GlobalInitialEvent() fsm.Event

	EntryEvent() fsm.Event

	EventsList() []fsm.Event

	StatesList() []fsm.State

	IsFinState(state fsm.State) bool
}

Jump to

Keyboard shortcuts

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