/
node_handler.go
184 lines (143 loc) · 5.35 KB
/
node_handler.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Code generated by mockery v1.0.1. DO NOT EDIT.
package mocks
import (
context "context"
handler "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler"
interfaces "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces"
mock "github.com/stretchr/testify/mock"
)
// NodeHandler is an autogenerated mock type for the NodeHandler type
type NodeHandler struct {
mock.Mock
}
type NodeHandler_Abort struct {
*mock.Call
}
func (_m NodeHandler_Abort) Return(_a0 error) *NodeHandler_Abort {
return &NodeHandler_Abort{Call: _m.Call.Return(_a0)}
}
func (_m *NodeHandler) OnAbort(ctx context.Context, executionContext interfaces.NodeExecutionContext, reason string) *NodeHandler_Abort {
c_call := _m.On("Abort", ctx, executionContext, reason)
return &NodeHandler_Abort{Call: c_call}
}
func (_m *NodeHandler) OnAbortMatch(matchers ...interface{}) *NodeHandler_Abort {
c_call := _m.On("Abort", matchers...)
return &NodeHandler_Abort{Call: c_call}
}
// Abort provides a mock function with given fields: ctx, executionContext, reason
func (_m *NodeHandler) Abort(ctx context.Context, executionContext interfaces.NodeExecutionContext, reason string) error {
ret := _m.Called(ctx, executionContext, reason)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, interfaces.NodeExecutionContext, string) error); ok {
r0 = rf(ctx, executionContext, reason)
} else {
r0 = ret.Error(0)
}
return r0
}
type NodeHandler_Finalize struct {
*mock.Call
}
func (_m NodeHandler_Finalize) Return(_a0 error) *NodeHandler_Finalize {
return &NodeHandler_Finalize{Call: _m.Call.Return(_a0)}
}
func (_m *NodeHandler) OnFinalize(ctx context.Context, executionContext interfaces.NodeExecutionContext) *NodeHandler_Finalize {
c_call := _m.On("Finalize", ctx, executionContext)
return &NodeHandler_Finalize{Call: c_call}
}
func (_m *NodeHandler) OnFinalizeMatch(matchers ...interface{}) *NodeHandler_Finalize {
c_call := _m.On("Finalize", matchers...)
return &NodeHandler_Finalize{Call: c_call}
}
// Finalize provides a mock function with given fields: ctx, executionContext
func (_m *NodeHandler) Finalize(ctx context.Context, executionContext interfaces.NodeExecutionContext) error {
ret := _m.Called(ctx, executionContext)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, interfaces.NodeExecutionContext) error); ok {
r0 = rf(ctx, executionContext)
} else {
r0 = ret.Error(0)
}
return r0
}
type NodeHandler_FinalizeRequired struct {
*mock.Call
}
func (_m NodeHandler_FinalizeRequired) Return(_a0 bool) *NodeHandler_FinalizeRequired {
return &NodeHandler_FinalizeRequired{Call: _m.Call.Return(_a0)}
}
func (_m *NodeHandler) OnFinalizeRequired() *NodeHandler_FinalizeRequired {
c_call := _m.On("FinalizeRequired")
return &NodeHandler_FinalizeRequired{Call: c_call}
}
func (_m *NodeHandler) OnFinalizeRequiredMatch(matchers ...interface{}) *NodeHandler_FinalizeRequired {
c_call := _m.On("FinalizeRequired", matchers...)
return &NodeHandler_FinalizeRequired{Call: c_call}
}
// FinalizeRequired provides a mock function with given fields:
func (_m *NodeHandler) FinalizeRequired() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
type NodeHandler_Handle struct {
*mock.Call
}
func (_m NodeHandler_Handle) Return(_a0 handler.Transition, _a1 error) *NodeHandler_Handle {
return &NodeHandler_Handle{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *NodeHandler) OnHandle(ctx context.Context, executionContext interfaces.NodeExecutionContext) *NodeHandler_Handle {
c_call := _m.On("Handle", ctx, executionContext)
return &NodeHandler_Handle{Call: c_call}
}
func (_m *NodeHandler) OnHandleMatch(matchers ...interface{}) *NodeHandler_Handle {
c_call := _m.On("Handle", matchers...)
return &NodeHandler_Handle{Call: c_call}
}
// Handle provides a mock function with given fields: ctx, executionContext
func (_m *NodeHandler) Handle(ctx context.Context, executionContext interfaces.NodeExecutionContext) (handler.Transition, error) {
ret := _m.Called(ctx, executionContext)
var r0 handler.Transition
if rf, ok := ret.Get(0).(func(context.Context, interfaces.NodeExecutionContext) handler.Transition); ok {
r0 = rf(ctx, executionContext)
} else {
r0 = ret.Get(0).(handler.Transition)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, interfaces.NodeExecutionContext) error); ok {
r1 = rf(ctx, executionContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type NodeHandler_Setup struct {
*mock.Call
}
func (_m NodeHandler_Setup) Return(_a0 error) *NodeHandler_Setup {
return &NodeHandler_Setup{Call: _m.Call.Return(_a0)}
}
func (_m *NodeHandler) OnSetup(ctx context.Context, setupContext interfaces.SetupContext) *NodeHandler_Setup {
c_call := _m.On("Setup", ctx, setupContext)
return &NodeHandler_Setup{Call: c_call}
}
func (_m *NodeHandler) OnSetupMatch(matchers ...interface{}) *NodeHandler_Setup {
c_call := _m.On("Setup", matchers...)
return &NodeHandler_Setup{Call: c_call}
}
// Setup provides a mock function with given fields: ctx, setupContext
func (_m *NodeHandler) Setup(ctx context.Context, setupContext interfaces.SetupContext) error {
ret := _m.Called(ctx, setupContext)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, interfaces.SetupContext) error); ok {
r0 = rf(ctx, setupContext)
} else {
r0 = ret.Error(0)
}
return r0
}