forked from YaoApp/gou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflow.types.go
41 lines (36 loc) · 1.33 KB
/
flow.types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package gou
import (
"context"
"github.com/yaoapp/gou/query/share"
)
// Flow 工作流
type Flow struct {
Name string `json:"-"`
Source string `json:"-"`
Scripts map[string]string `json:"-"`
Label string `json:"label"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Nodes []FlowNode `json:"nodes,omitempty"`
Output interface{} `json:"output,omitempty"`
Global map[string]interface{} // 全局变量
Sid string // 会话ID
}
// FlowNode 工作流节点
type FlowNode struct {
Name string `json:"name,omitempty"`
Process string `json:"process,omitempty"`
Engine string `json:"engine,omitempty"` // 数据分析引擎名称
Query interface{} `json:"query,omitempty"` // 数据分析语言 Query Source
DSL share.DSL `json:"-"` // 数据分析语言 Query DSL
Script string `json:"script,omitempty"`
Args []interface{} `json:"args,omitempty"`
Outs []interface{} `json:"outs,omitempty"`
}
// FlowContext 工作流上下文
type FlowContext struct {
In []interface{}
Res map[string]interface{}
Context *context.Context
Cancel context.CancelFunc
}