This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
reader.go
55 lines (49 loc) · 1.5 KB
/
reader.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package common
import (
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
)
type NodeID = string
type TaskID = Identifier
type WorkflowID = Identifier
type LaunchPlanID = Identifier
type TaskIDKey = string
type WorkflowIDKey = string
// An immutable workflow that represents the final output of the compiler.
type Workflow interface {
GetNode(id NodeID) (node NodeBuilder, found bool)
GetTask(id TaskID) (task Task, found bool)
GetLaunchPlan(id LaunchPlanID) (wf InterfaceProvider, found bool)
GetSubWorkflow(id WorkflowID) (wf *core.CompiledWorkflow, found bool)
GetCoreWorkflow() *core.CompiledWorkflow
GetFailureNode() Node
GetNodes() NodeIndex
GetTasks() TaskIndex
GetDownstreamNodes() StringAdjacencyList
GetUpstreamNodes() StringAdjacencyList
}
// An immutable Node that represents the final output of the compiler.
type Node interface {
GetId() NodeID
GetInterface() *core.TypedInterface
GetInputs() []*core.Binding
GetWorkflowNode() *core.WorkflowNode
GetOutputAliases() []*core.Alias
GetUpstreamNodeIds() []string
GetCoreNode() *core.Node
GetBranchNode() *core.BranchNode
GetTaskNode() *core.TaskNode
GetMetadata() *core.NodeMetadata
GetTask() Task
GetSubWorkflow() Workflow
}
// An immutable task that represents the final output of the compiler.
type Task interface {
GetID() TaskID
GetCoreTask() *core.TaskTemplate
GetInterface() *core.TypedInterface
}
type InterfaceProvider interface {
GetID() *core.Identifier
GetExpectedInputs() *core.ParameterMap
GetExpectedOutputs() *core.VariableMap
}