feat: expose workflow runtime through HTTP and Go SDK
This commit is contained in:
@@ -57,13 +57,14 @@ type StartResult struct {
|
||||
|
||||
// StepView 只列元数据,避免把最多128个大输入输出聚合为无界响应。
|
||||
type StepView struct {
|
||||
ID core.ID `json:"id"` // ID 实例内逻辑步骤身份。
|
||||
Key string `json:"key"` // Key 固定定义步骤名称。
|
||||
Kind weave.NodeKind `json:"kind"` // Kind 固定节点类型。
|
||||
State weave.StepState `json:"state"` // State 当前步骤状态。
|
||||
Revision uint64 `json:"revision,string"` // Revision 步骤并发版本。
|
||||
ActivationID *core.ID `json:"activation_id,omitempty"` // ActivationID 当前激活,未激活时为空。
|
||||
TaskID *core.ID `json:"task_id,omitempty"` // TaskID TASK的直接任务;POLL任务通过轮次查询。
|
||||
ActivationSequence uint32 `json:"activation_sequence,omitempty"` // ActivationSequence 当前激活代次;未激活时省略,信号必须显式指定此代次。
|
||||
ID core.ID `json:"id"` // ID 实例内逻辑步骤身份。
|
||||
Key string `json:"key"` // Key 固定定义步骤名称。
|
||||
Kind weave.NodeKind `json:"kind"` // Kind 固定节点类型。
|
||||
State weave.StepState `json:"state"` // State 当前步骤状态。
|
||||
Revision uint64 `json:"revision,string"` // Revision 步骤并发版本。
|
||||
ActivationID *core.ID `json:"activation_id,omitempty"` // ActivationID 当前激活,未激活时为空。
|
||||
TaskID *core.ID `json:"task_id,omitempty"` // TaskID TASK的直接任务;POLL任务通过轮次查询。
|
||||
}
|
||||
type StepsView struct {
|
||||
InstanceID core.ID `json:"instance_id"` // InstanceID 所属实例。
|
||||
@@ -71,9 +72,12 @@ type StepsView struct {
|
||||
Steps []StepView `json:"steps"` // Steps 按键排序,最多128个,不含内部根检查点。
|
||||
}
|
||||
type Store interface {
|
||||
ListOperations(context.Context, auth.Token, core.ID, service.HistoryPageInput) (OperationPage, error)
|
||||
GetOperation(context.Context, auth.Token, core.ID, core.ID) (OperationView, error)
|
||||
Start(context.Context, auth.Token, string, StartInput) (StartResult, error)
|
||||
Get(context.Context, auth.Token, core.ID) (View, error)
|
||||
Steps(context.Context, auth.Token, core.ID) (StepsView, error)
|
||||
Step(context.Context, auth.Token, core.ID, string) (StepDetail, error)
|
||||
}
|
||||
type Service struct{ store Store }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user