package
Version:
v1.0.28
Opens a new window with list of versions in this module.
Published: Jun 5, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
创建并运行状态机
logger: 设置logger
stateEntries: 状态机表
firstState: 初始state
firstEvent: 初始event
data: 用户数据
response: 应答回调
type EventNode struct {
NextState StateT
Callback func(*GSM, interface{})
}
func (g *GSM) TriggerToNextState(event EventT, data interface{})
根据event触发下一个state
type TransData struct {
Event EventT
Data interface{}
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.