Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
sync.Locker //锁
Data map[string]interface{} `json:"data"` // 共享数据
NodeID string `json:"nodeID"` // 当前节点ID
Workflow *Workflow `json:"workflow"` // 所属工作流
}
Context 工作流上下文
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
DAG 有序无向图 提供方法:添加顶点,添加边,获取有向图
type Node ¶
type Node struct {
ID string `json:"ID"` // 节点唯一标识
Action func(ctx Context) error `json:"-"` // 执行函数
RetryPolicy int `json:"RetryPolicy"` // 重试次数
DependsOn []string `json:"DependsOn"` // 依赖的节点ID
}
Node 工作流节点定义
Click to show internal directories.
Click to hide internal directories.