/
mock_index.go
404 lines (349 loc) · 14.1 KB
/
mock_index.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/anyproto/any-sync-filenode/index (interfaces: Index)
//
// Generated by this command:
//
// mockgen -destination mock_index/mock_index.go github.com/anyproto/any-sync-filenode/index Index
//
// Package mock_index is a generated GoMock package.
package mock_index
import (
context "context"
reflect "reflect"
index "github.com/anyproto/any-sync-filenode/index"
app "github.com/anyproto/any-sync/app"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
gomock "go.uber.org/mock/gomock"
)
// MockIndex is a mock of Index interface.
type MockIndex struct {
ctrl *gomock.Controller
recorder *MockIndexMockRecorder
}
// MockIndexMockRecorder is the mock recorder for MockIndex.
type MockIndexMockRecorder struct {
mock *MockIndex
}
// NewMockIndex creates a new mock instance.
func NewMockIndex(ctrl *gomock.Controller) *MockIndex {
mock := &MockIndex{ctrl: ctrl}
mock.recorder = &MockIndexMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockIndex) EXPECT() *MockIndexMockRecorder {
return m.recorder
}
// BlocksAdd mocks base method.
func (m *MockIndex) BlocksAdd(arg0 context.Context, arg1 []blocks.Block) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BlocksAdd", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// BlocksAdd indicates an expected call of BlocksAdd.
func (mr *MockIndexMockRecorder) BlocksAdd(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlocksAdd", reflect.TypeOf((*MockIndex)(nil).BlocksAdd), arg0, arg1)
}
// BlocksGetNonExistent mocks base method.
func (m *MockIndex) BlocksGetNonExistent(arg0 context.Context, arg1 []blocks.Block) ([]blocks.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BlocksGetNonExistent", arg0, arg1)
ret0, _ := ret[0].([]blocks.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BlocksGetNonExistent indicates an expected call of BlocksGetNonExistent.
func (mr *MockIndexMockRecorder) BlocksGetNonExistent(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlocksGetNonExistent", reflect.TypeOf((*MockIndex)(nil).BlocksGetNonExistent), arg0, arg1)
}
// BlocksLock mocks base method.
func (m *MockIndex) BlocksLock(arg0 context.Context, arg1 []blocks.Block) (func(), error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BlocksLock", arg0, arg1)
ret0, _ := ret[0].(func())
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BlocksLock indicates an expected call of BlocksLock.
func (mr *MockIndexMockRecorder) BlocksLock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlocksLock", reflect.TypeOf((*MockIndex)(nil).BlocksLock), arg0, arg1)
}
// CheckLimits mocks base method.
func (m *MockIndex) CheckLimits(arg0 context.Context, arg1 index.Key) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CheckLimits", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CheckLimits indicates an expected call of CheckLimits.
func (mr *MockIndexMockRecorder) CheckLimits(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckLimits", reflect.TypeOf((*MockIndex)(nil).CheckLimits), arg0, arg1)
}
// CidEntries mocks base method.
func (m *MockIndex) CidEntries(arg0 context.Context, arg1 []cid.Cid) (*index.CidEntries, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CidEntries", arg0, arg1)
ret0, _ := ret[0].(*index.CidEntries)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CidEntries indicates an expected call of CidEntries.
func (mr *MockIndexMockRecorder) CidEntries(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CidEntries", reflect.TypeOf((*MockIndex)(nil).CidEntries), arg0, arg1)
}
// CidEntriesByBlocks mocks base method.
func (m *MockIndex) CidEntriesByBlocks(arg0 context.Context, arg1 []blocks.Block) (*index.CidEntries, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CidEntriesByBlocks", arg0, arg1)
ret0, _ := ret[0].(*index.CidEntries)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CidEntriesByBlocks indicates an expected call of CidEntriesByBlocks.
func (mr *MockIndexMockRecorder) CidEntriesByBlocks(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CidEntriesByBlocks", reflect.TypeOf((*MockIndex)(nil).CidEntriesByBlocks), arg0, arg1)
}
// CidExists mocks base method.
func (m *MockIndex) CidExists(arg0 context.Context, arg1 cid.Cid) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CidExists", arg0, arg1)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CidExists indicates an expected call of CidExists.
func (mr *MockIndexMockRecorder) CidExists(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CidExists", reflect.TypeOf((*MockIndex)(nil).CidExists), arg0, arg1)
}
// CidExistsInSpace mocks base method.
func (m *MockIndex) CidExistsInSpace(arg0 context.Context, arg1 index.Key, arg2 []cid.Cid) ([]cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CidExistsInSpace", arg0, arg1, arg2)
ret0, _ := ret[0].([]cid.Cid)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CidExistsInSpace indicates an expected call of CidExistsInSpace.
func (mr *MockIndexMockRecorder) CidExistsInSpace(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CidExistsInSpace", reflect.TypeOf((*MockIndex)(nil).CidExistsInSpace), arg0, arg1, arg2)
}
// Close mocks base method.
func (m *MockIndex) Close(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close.
func (mr *MockIndexMockRecorder) Close(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockIndex)(nil).Close), arg0)
}
// FileBind mocks base method.
func (m *MockIndex) FileBind(arg0 context.Context, arg1 index.Key, arg2 string, arg3 *index.CidEntries) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FileBind", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// FileBind indicates an expected call of FileBind.
func (mr *MockIndexMockRecorder) FileBind(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FileBind", reflect.TypeOf((*MockIndex)(nil).FileBind), arg0, arg1, arg2, arg3)
}
// FileInfo mocks base method.
func (m *MockIndex) FileInfo(arg0 context.Context, arg1 index.Key, arg2 ...string) ([]index.FileInfo, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "FileInfo", varargs...)
ret0, _ := ret[0].([]index.FileInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FileInfo indicates an expected call of FileInfo.
func (mr *MockIndexMockRecorder) FileInfo(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FileInfo", reflect.TypeOf((*MockIndex)(nil).FileInfo), varargs...)
}
// FileUnbind mocks base method.
func (m *MockIndex) FileUnbind(arg0 context.Context, arg1 index.Key, arg2 ...string) error {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "FileUnbind", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// FileUnbind indicates an expected call of FileUnbind.
func (mr *MockIndexMockRecorder) FileUnbind(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FileUnbind", reflect.TypeOf((*MockIndex)(nil).FileUnbind), varargs...)
}
// FilesList mocks base method.
func (m *MockIndex) FilesList(arg0 context.Context, arg1 index.Key) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FilesList", arg0, arg1)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FilesList indicates an expected call of FilesList.
func (mr *MockIndexMockRecorder) FilesList(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilesList", reflect.TypeOf((*MockIndex)(nil).FilesList), arg0, arg1)
}
// GroupInfo mocks base method.
func (m *MockIndex) GroupInfo(arg0 context.Context, arg1 string) (index.GroupInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GroupInfo", arg0, arg1)
ret0, _ := ret[0].(index.GroupInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GroupInfo indicates an expected call of GroupInfo.
func (mr *MockIndexMockRecorder) GroupInfo(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GroupInfo", reflect.TypeOf((*MockIndex)(nil).GroupInfo), arg0, arg1)
}
// Init mocks base method.
func (m *MockIndex) Init(arg0 *app.App) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Init", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Init indicates an expected call of Init.
func (mr *MockIndexMockRecorder) Init(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockIndex)(nil).Init), arg0)
}
// Migrate mocks base method.
func (m *MockIndex) Migrate(arg0 context.Context, arg1 index.Key) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Migrate", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Migrate indicates an expected call of Migrate.
func (mr *MockIndexMockRecorder) Migrate(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Migrate", reflect.TypeOf((*MockIndex)(nil).Migrate), arg0, arg1)
}
// Name mocks base method.
func (m *MockIndex) Name() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Name")
ret0, _ := ret[0].(string)
return ret0
}
// Name indicates an expected call of Name.
func (mr *MockIndexMockRecorder) Name() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockIndex)(nil).Name))
}
// OnBlockUploaded mocks base method.
func (m *MockIndex) OnBlockUploaded(arg0 context.Context, arg1 ...blocks.Block) {
m.ctrl.T.Helper()
varargs := []any{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
m.ctrl.Call(m, "OnBlockUploaded", varargs...)
}
// OnBlockUploaded indicates an expected call of OnBlockUploaded.
func (mr *MockIndexMockRecorder) OnBlockUploaded(arg0 any, arg1 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnBlockUploaded", reflect.TypeOf((*MockIndex)(nil).OnBlockUploaded), varargs...)
}
// Run mocks base method.
func (m *MockIndex) Run(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Run", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Run indicates an expected call of Run.
func (mr *MockIndexMockRecorder) Run(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockIndex)(nil).Run), arg0)
}
// SetGroupLimit mocks base method.
func (m *MockIndex) SetGroupLimit(arg0 context.Context, arg1 string, arg2 uint64) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetGroupLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// SetGroupLimit indicates an expected call of SetGroupLimit.
func (mr *MockIndexMockRecorder) SetGroupLimit(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetGroupLimit", reflect.TypeOf((*MockIndex)(nil).SetGroupLimit), arg0, arg1, arg2)
}
// SetSpaceLimit mocks base method.
func (m *MockIndex) SetSpaceLimit(arg0 context.Context, arg1 index.Key, arg2 uint64) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetSpaceLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// SetSpaceLimit indicates an expected call of SetSpaceLimit.
func (mr *MockIndexMockRecorder) SetSpaceLimit(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSpaceLimit", reflect.TypeOf((*MockIndex)(nil).SetSpaceLimit), arg0, arg1, arg2)
}
// SpaceDelete mocks base method.
func (m *MockIndex) SpaceDelete(arg0 context.Context, arg1 index.Key) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SpaceDelete", arg0, arg1)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SpaceDelete indicates an expected call of SpaceDelete.
func (mr *MockIndexMockRecorder) SpaceDelete(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceDelete", reflect.TypeOf((*MockIndex)(nil).SpaceDelete), arg0, arg1)
}
// SpaceInfo mocks base method.
func (m *MockIndex) SpaceInfo(arg0 context.Context, arg1 index.Key) (index.SpaceInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SpaceInfo", arg0, arg1)
ret0, _ := ret[0].(index.SpaceInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SpaceInfo indicates an expected call of SpaceInfo.
func (mr *MockIndexMockRecorder) SpaceInfo(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceInfo", reflect.TypeOf((*MockIndex)(nil).SpaceInfo), arg0, arg1)
}
// WaitCidExists mocks base method.
func (m *MockIndex) WaitCidExists(arg0 context.Context, arg1 cid.Cid) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitCidExists", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// WaitCidExists indicates an expected call of WaitCidExists.
func (mr *MockIndexMockRecorder) WaitCidExists(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitCidExists", reflect.TypeOf((*MockIndex)(nil).WaitCidExists), arg0, arg1)
}