forked from dustin/gomemcached
/
mock_memcachedConnection.go
265 lines (214 loc) · 7.11 KB
/
mock_memcachedConnection.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
// Code generated by mockery. DO NOT EDIT.
package mocks
import (
time "time"
mock "github.com/stretchr/testify/mock"
)
// memcachedConnection is an autogenerated mock type for the memcachedConnection type
type memcachedConnection struct {
mock.Mock
}
type memcachedConnection_Expecter struct {
mock *mock.Mock
}
func (_m *memcachedConnection) EXPECT() *memcachedConnection_Expecter {
return &memcachedConnection_Expecter{mock: &_m.Mock}
}
// Close provides a mock function with given fields:
func (_m *memcachedConnection) Close() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// memcachedConnection_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type memcachedConnection_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *memcachedConnection_Expecter) Close() *memcachedConnection_Close_Call {
return &memcachedConnection_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *memcachedConnection_Close_Call) Run(run func()) *memcachedConnection_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *memcachedConnection_Close_Call) Return(_a0 error) *memcachedConnection_Close_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *memcachedConnection_Close_Call) RunAndReturn(run func() error) *memcachedConnection_Close_Call {
_c.Call.Return(run)
return _c
}
// Read provides a mock function with given fields: p
func (_m *memcachedConnection) Read(p []byte) (int, error) {
ret := _m.Called(p)
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok {
return rf(p)
}
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// memcachedConnection_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
type memcachedConnection_Read_Call struct {
*mock.Call
}
// Read is a helper method to define mock.On call
// - p []byte
func (_e *memcachedConnection_Expecter) Read(p interface{}) *memcachedConnection_Read_Call {
return &memcachedConnection_Read_Call{Call: _e.mock.On("Read", p)}
}
func (_c *memcachedConnection_Read_Call) Run(run func(p []byte)) *memcachedConnection_Read_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]byte))
})
return _c
}
func (_c *memcachedConnection_Read_Call) Return(n int, err error) *memcachedConnection_Read_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *memcachedConnection_Read_Call) RunAndReturn(run func([]byte) (int, error)) *memcachedConnection_Read_Call {
_c.Call.Return(run)
return _c
}
// SetDeadline provides a mock function with given fields: _a0
func (_m *memcachedConnection) SetDeadline(_a0 time.Time) error {
ret := _m.Called(_a0)
var r0 error
if rf, ok := ret.Get(0).(func(time.Time) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// memcachedConnection_SetDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDeadline'
type memcachedConnection_SetDeadline_Call struct {
*mock.Call
}
// SetDeadline is a helper method to define mock.On call
// - _a0 time.Time
func (_e *memcachedConnection_Expecter) SetDeadline(_a0 interface{}) *memcachedConnection_SetDeadline_Call {
return &memcachedConnection_SetDeadline_Call{Call: _e.mock.On("SetDeadline", _a0)}
}
func (_c *memcachedConnection_SetDeadline_Call) Run(run func(_a0 time.Time)) *memcachedConnection_SetDeadline_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Time))
})
return _c
}
func (_c *memcachedConnection_SetDeadline_Call) Return(_a0 error) *memcachedConnection_SetDeadline_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *memcachedConnection_SetDeadline_Call) RunAndReturn(run func(time.Time) error) *memcachedConnection_SetDeadline_Call {
_c.Call.Return(run)
return _c
}
// SetReadDeadline provides a mock function with given fields: _a0
func (_m *memcachedConnection) SetReadDeadline(_a0 time.Time) error {
ret := _m.Called(_a0)
var r0 error
if rf, ok := ret.Get(0).(func(time.Time) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// memcachedConnection_SetReadDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReadDeadline'
type memcachedConnection_SetReadDeadline_Call struct {
*mock.Call
}
// SetReadDeadline is a helper method to define mock.On call
// - _a0 time.Time
func (_e *memcachedConnection_Expecter) SetReadDeadline(_a0 interface{}) *memcachedConnection_SetReadDeadline_Call {
return &memcachedConnection_SetReadDeadline_Call{Call: _e.mock.On("SetReadDeadline", _a0)}
}
func (_c *memcachedConnection_SetReadDeadline_Call) Run(run func(_a0 time.Time)) *memcachedConnection_SetReadDeadline_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Time))
})
return _c
}
func (_c *memcachedConnection_SetReadDeadline_Call) Return(_a0 error) *memcachedConnection_SetReadDeadline_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *memcachedConnection_SetReadDeadline_Call) RunAndReturn(run func(time.Time) error) *memcachedConnection_SetReadDeadline_Call {
_c.Call.Return(run)
return _c
}
// Write provides a mock function with given fields: p
func (_m *memcachedConnection) Write(p []byte) (int, error) {
ret := _m.Called(p)
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok {
return rf(p)
}
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// memcachedConnection_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
type memcachedConnection_Write_Call struct {
*mock.Call
}
// Write is a helper method to define mock.On call
// - p []byte
func (_e *memcachedConnection_Expecter) Write(p interface{}) *memcachedConnection_Write_Call {
return &memcachedConnection_Write_Call{Call: _e.mock.On("Write", p)}
}
func (_c *memcachedConnection_Write_Call) Run(run func(p []byte)) *memcachedConnection_Write_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]byte))
})
return _c
}
func (_c *memcachedConnection_Write_Call) Return(n int, err error) *memcachedConnection_Write_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *memcachedConnection_Write_Call) RunAndReturn(run func([]byte) (int, error)) *memcachedConnection_Write_Call {
_c.Call.Return(run)
return _c
}
// newMemcachedConnection creates a new instance of memcachedConnection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newMemcachedConnection(t interface {
mock.TestingT
Cleanup(func())
}) *memcachedConnection {
mock := &memcachedConnection{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}