-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
39 lines (32 loc) · 776 Bytes
/
types.go
File metadata and controls
39 lines (32 loc) · 776 Bytes
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
package parallel
// WorkflowInput is the initial input for the workflow
type WorkflowInput struct {
Val1 int `json:"val1"`
Val2 int `json:"val2"`
Mult int `json:"mult"`
}
// Step 1: Add
type AddInput struct {
A int `json:"val1"` // Map from WorkflowInput.Val1
B int `json:"val2"` // Map from WorkflowInput.Val2
M int `json:"mult"` // Map from WorkflowInput.Mult
}
type AddOutput struct {
Value int `json:"value"` // Result
Mult int `json:"mult"` // Pass through
}
// Step 2: Multiply
type MultiplyInput struct {
Value int `json:"value"`
Factor int `json:"mult"`
}
type MultiplyOutput struct {
Value int `json:"value"`
}
// Step 3: Format
type FormatInput struct {
Number int `json:"value"`
}
type FormatOutput struct {
Message string `json:"message"`
}