forked from yarpc/yarpc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
204 lines (182 loc) · 5.19 KB
/
client.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Code generated by thriftrw-plugin-yarpc
// @generated
package storetest
import (
"context"
"github.com/golang/mock/gomock"
"go.uber.org/yarpc"
"go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/atomic"
"go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/atomic/storeclient"
)
// MockClient implements a gomock-compatible mock client for service
// Store.
type MockClient struct {
ctrl *gomock.Controller
recorder *_MockClientRecorder
}
var _ storeclient.Interface = (*MockClient)(nil)
type _MockClientRecorder struct {
mock *MockClient
}
// Build a new mock client for service Store.
//
// mockCtrl := gomock.NewController(t)
// client := storetest.NewMockClient(mockCtrl)
//
// Use EXPECT() to set expectations on the mock.
func NewMockClient(ctrl *gomock.Controller) *MockClient {
mock := &MockClient{ctrl: ctrl}
mock.recorder = &_MockClientRecorder{mock}
return mock
}
// EXPECT returns an object that allows you to define an expectation on the
// Store mock client.
func (m *MockClient) EXPECT() *_MockClientRecorder {
return m.recorder
}
// CompareAndSwap responds to a CompareAndSwap call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().CompareAndSwap(gomock.Any(), ...).Return(...)
// ... := client.CompareAndSwap(...)
func (m *MockClient) CompareAndSwap(
ctx context.Context,
_Request *atomic.CompareAndSwap,
opts ...yarpc.CallOption,
) (err error) {
args := []interface{}{ctx, _Request}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "CompareAndSwap", args...)
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) CompareAndSwap(
ctx interface{},
_Request interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx, _Request}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "CompareAndSwap", args...)
}
// Forget responds to a Forget call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().Forget(gomock.Any(), ...).Return(...)
// ... := client.Forget(...)
func (m *MockClient) Forget(
ctx context.Context,
_Key *string,
opts ...yarpc.CallOption,
) (ack yarpc.Ack, err error) {
args := []interface{}{ctx, _Key}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "Forget", args...)
ack, _ = ret[i].(yarpc.Ack)
i++
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) Forget(
ctx interface{},
_Key interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx, _Key}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "Forget", args...)
}
// Increment responds to a Increment call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().Increment(gomock.Any(), ...).Return(...)
// ... := client.Increment(...)
func (m *MockClient) Increment(
ctx context.Context,
_Key *string,
_Value *int64,
opts ...yarpc.CallOption,
) (err error) {
args := []interface{}{ctx, _Key, _Value}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "Increment", args...)
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) Increment(
ctx interface{},
_Key interface{},
_Value interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx, _Key, _Value}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "Increment", args...)
}
// Integer responds to a Integer call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().Integer(gomock.Any(), ...).Return(...)
// ... := client.Integer(...)
func (m *MockClient) Integer(
ctx context.Context,
_Key *string,
opts ...yarpc.CallOption,
) (success int64, err error) {
args := []interface{}{ctx, _Key}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "Integer", args...)
success, _ = ret[i].(int64)
i++
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) Integer(
ctx interface{},
_Key interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx, _Key}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "Integer", args...)
}
// Healthy responds to a Healthy call based on the mock expectations. This
// call will fail if the mock does not expect this call. Use EXPECT to expect
// a call to this function.
//
// client.EXPECT().Healthy(gomock.Any(), ...).Return(...)
// ... := client.Healthy(...)
func (m *MockClient) Healthy(
ctx context.Context,
opts ...yarpc.CallOption,
) (success bool, err error) {
args := []interface{}{ctx}
for _, o := range opts {
args = append(args, o)
}
i := 0
ret := m.ctrl.Call(m, "Healthy", args...)
success, _ = ret[i].(bool)
i++
err, _ = ret[i].(error)
return
}
func (mr *_MockClientRecorder) Healthy(
ctx interface{},
opts ...interface{},
) *gomock.Call {
args := append([]interface{}{ctx}, opts...)
return mr.mock.ctrl.RecordCall(mr.mock, "Healthy", args...)
}