This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
mock_database.go
353 lines (295 loc) · 13.5 KB
/
mock_database.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
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/skygeario/skygear-server/pkg/server/skydb (interfaces: Database)
package mock_skydb
import (
gomock "github.com/golang/mock/gomock"
skydb "github.com/skygeario/skygear-server/pkg/server/skydb"
reflect "reflect"
)
// MockDatabase is a mock of Database interface
type MockDatabase struct {
ctrl *gomock.Controller
recorder *MockDatabaseMockRecorder
}
// MockDatabaseMockRecorder is the mock recorder for MockDatabase
type MockDatabaseMockRecorder struct {
mock *MockDatabase
}
// NewMockDatabase creates a new mock instance
func NewMockDatabase(ctrl *gomock.Controller) *MockDatabase {
mock := &MockDatabase{ctrl: ctrl}
mock.recorder = &MockDatabaseMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (_m *MockDatabase) EXPECT() *MockDatabaseMockRecorder {
return _m.recorder
}
// Conn mocks base method
func (_m *MockDatabase) Conn() skydb.Conn {
ret := _m.ctrl.Call(_m, "Conn")
ret0, _ := ret[0].(skydb.Conn)
return ret0
}
// Conn indicates an expected call of Conn
func (_mr *MockDatabaseMockRecorder) Conn() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Conn", reflect.TypeOf((*MockDatabase)(nil).Conn))
}
// DatabaseType mocks base method
func (_m *MockDatabase) DatabaseType() skydb.DatabaseType {
ret := _m.ctrl.Call(_m, "DatabaseType")
ret0, _ := ret[0].(skydb.DatabaseType)
return ret0
}
// DatabaseType indicates an expected call of DatabaseType
func (_mr *MockDatabaseMockRecorder) DatabaseType() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "DatabaseType", reflect.TypeOf((*MockDatabase)(nil).DatabaseType))
}
// Delete mocks base method
func (_m *MockDatabase) Delete(_param0 skydb.RecordID) error {
ret := _m.ctrl.Call(_m, "Delete", _param0)
ret0, _ := ret[0].(error)
return ret0
}
// Delete indicates an expected call of Delete
func (_mr *MockDatabaseMockRecorder) Delete(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Delete", reflect.TypeOf((*MockDatabase)(nil).Delete), arg0)
}
// DeleteIndex mocks base method
func (_m *MockDatabase) DeleteIndex(_param0 string, _param1 string) error {
ret := _m.ctrl.Call(_m, "DeleteIndex", _param0, _param1)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteIndex indicates an expected call of DeleteIndex
func (_mr *MockDatabaseMockRecorder) DeleteIndex(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "DeleteIndex", reflect.TypeOf((*MockDatabase)(nil).DeleteIndex), arg0, arg1)
}
// DeleteSchema mocks base method
func (_m *MockDatabase) DeleteSchema(_param0 string, _param1 string) error {
ret := _m.ctrl.Call(_m, "DeleteSchema", _param0, _param1)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteSchema indicates an expected call of DeleteSchema
func (_mr *MockDatabaseMockRecorder) DeleteSchema(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "DeleteSchema", reflect.TypeOf((*MockDatabase)(nil).DeleteSchema), arg0, arg1)
}
// DeleteSubscription mocks base method
func (_m *MockDatabase) DeleteSubscription(_param0 string, _param1 string) error {
ret := _m.ctrl.Call(_m, "DeleteSubscription", _param0, _param1)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteSubscription indicates an expected call of DeleteSubscription
func (_mr *MockDatabaseMockRecorder) DeleteSubscription(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "DeleteSubscription", reflect.TypeOf((*MockDatabase)(nil).DeleteSubscription), arg0, arg1)
}
// Extend mocks base method
func (_m *MockDatabase) Extend(_param0 string, _param1 skydb.RecordSchema) (bool, error) {
ret := _m.ctrl.Call(_m, "Extend", _param0, _param1)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Extend indicates an expected call of Extend
func (_mr *MockDatabaseMockRecorder) Extend(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Extend", reflect.TypeOf((*MockDatabase)(nil).Extend), arg0, arg1)
}
// Get mocks base method
func (_m *MockDatabase) Get(_param0 skydb.RecordID, _param1 *skydb.Record) error {
ret := _m.ctrl.Call(_m, "Get", _param0, _param1)
ret0, _ := ret[0].(error)
return ret0
}
// Get indicates an expected call of Get
func (_mr *MockDatabaseMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Get", reflect.TypeOf((*MockDatabase)(nil).Get), arg0, arg1)
}
// GetByIDs mocks base method
func (_m *MockDatabase) GetByIDs(_param0 []skydb.RecordID, _param1 *skydb.AccessControlOptions) (*skydb.Rows, error) {
ret := _m.ctrl.Call(_m, "GetByIDs", _param0, _param1)
ret0, _ := ret[0].(*skydb.Rows)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetByIDs indicates an expected call of GetByIDs
func (_mr *MockDatabaseMockRecorder) GetByIDs(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetByIDs", reflect.TypeOf((*MockDatabase)(nil).GetByIDs), arg0, arg1)
}
// GetIndexesByRecordType mocks base method
func (_m *MockDatabase) GetIndexesByRecordType(_param0 string) (map[string]skydb.Index, error) {
ret := _m.ctrl.Call(_m, "GetIndexesByRecordType", _param0)
ret0, _ := ret[0].(map[string]skydb.Index)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetIndexesByRecordType indicates an expected call of GetIndexesByRecordType
func (_mr *MockDatabaseMockRecorder) GetIndexesByRecordType(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetIndexesByRecordType", reflect.TypeOf((*MockDatabase)(nil).GetIndexesByRecordType), arg0)
}
// GetMatchingSubscriptions mocks base method
func (_m *MockDatabase) GetMatchingSubscriptions(_param0 *skydb.Record) []skydb.Subscription {
ret := _m.ctrl.Call(_m, "GetMatchingSubscriptions", _param0)
ret0, _ := ret[0].([]skydb.Subscription)
return ret0
}
// GetMatchingSubscriptions indicates an expected call of GetMatchingSubscriptions
func (_mr *MockDatabaseMockRecorder) GetMatchingSubscriptions(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetMatchingSubscriptions", reflect.TypeOf((*MockDatabase)(nil).GetMatchingSubscriptions), arg0)
}
// GetRecordSchemas mocks base method
func (_m *MockDatabase) GetRecordSchemas() (map[string]skydb.RecordSchema, error) {
ret := _m.ctrl.Call(_m, "GetRecordSchemas")
ret0, _ := ret[0].(map[string]skydb.RecordSchema)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetRecordSchemas indicates an expected call of GetRecordSchemas
func (_mr *MockDatabaseMockRecorder) GetRecordSchemas() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetRecordSchemas", reflect.TypeOf((*MockDatabase)(nil).GetRecordSchemas))
}
// GetSchema mocks base method
func (_m *MockDatabase) GetSchema(_param0 string) (skydb.RecordSchema, error) {
ret := _m.ctrl.Call(_m, "GetSchema", _param0)
ret0, _ := ret[0].(skydb.RecordSchema)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSchema indicates an expected call of GetSchema
func (_mr *MockDatabaseMockRecorder) GetSchema(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetSchema", reflect.TypeOf((*MockDatabase)(nil).GetSchema), arg0)
}
// GetSubscription mocks base method
func (_m *MockDatabase) GetSubscription(_param0 string, _param1 string, _param2 *skydb.Subscription) error {
ret := _m.ctrl.Call(_m, "GetSubscription", _param0, _param1, _param2)
ret0, _ := ret[0].(error)
return ret0
}
// GetSubscription indicates an expected call of GetSubscription
func (_mr *MockDatabaseMockRecorder) GetSubscription(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetSubscription", reflect.TypeOf((*MockDatabase)(nil).GetSubscription), arg0, arg1, arg2)
}
// GetSubscriptionsByDeviceID mocks base method
func (_m *MockDatabase) GetSubscriptionsByDeviceID(_param0 string) []skydb.Subscription {
ret := _m.ctrl.Call(_m, "GetSubscriptionsByDeviceID", _param0)
ret0, _ := ret[0].([]skydb.Subscription)
return ret0
}
// GetSubscriptionsByDeviceID indicates an expected call of GetSubscriptionsByDeviceID
func (_mr *MockDatabaseMockRecorder) GetSubscriptionsByDeviceID(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetSubscriptionsByDeviceID", reflect.TypeOf((*MockDatabase)(nil).GetSubscriptionsByDeviceID), arg0)
}
// ID mocks base method
func (_m *MockDatabase) ID() string {
ret := _m.ctrl.Call(_m, "ID")
ret0, _ := ret[0].(string)
return ret0
}
// ID indicates an expected call of ID
func (_mr *MockDatabaseMockRecorder) ID() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "ID", reflect.TypeOf((*MockDatabase)(nil).ID))
}
// IsReadOnly mocks base method
func (_m *MockDatabase) IsReadOnly() bool {
ret := _m.ctrl.Call(_m, "IsReadOnly")
ret0, _ := ret[0].(bool)
return ret0
}
// IsReadOnly indicates an expected call of IsReadOnly
func (_mr *MockDatabaseMockRecorder) IsReadOnly() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "IsReadOnly", reflect.TypeOf((*MockDatabase)(nil).IsReadOnly))
}
// Query mocks base method
func (_m *MockDatabase) Query(_param0 *skydb.Query, _param1 *skydb.AccessControlOptions) (*skydb.Rows, error) {
ret := _m.ctrl.Call(_m, "Query", _param0, _param1)
ret0, _ := ret[0].(*skydb.Rows)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Query indicates an expected call of Query
func (_mr *MockDatabaseMockRecorder) Query(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Query", reflect.TypeOf((*MockDatabase)(nil).Query), arg0, arg1)
}
// QueryCount mocks base method
func (_m *MockDatabase) QueryCount(_param0 *skydb.Query, _param1 *skydb.AccessControlOptions) (uint64, error) {
ret := _m.ctrl.Call(_m, "QueryCount", _param0, _param1)
ret0, _ := ret[0].(uint64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// QueryCount indicates an expected call of QueryCount
func (_mr *MockDatabaseMockRecorder) QueryCount(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "QueryCount", reflect.TypeOf((*MockDatabase)(nil).QueryCount), arg0, arg1)
}
// RemoteColumnTypes mocks base method
func (_m *MockDatabase) RemoteColumnTypes(_param0 string) (skydb.RecordSchema, error) {
ret := _m.ctrl.Call(_m, "RemoteColumnTypes", _param0)
ret0, _ := ret[0].(skydb.RecordSchema)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// RemoteColumnTypes indicates an expected call of RemoteColumnTypes
func (_mr *MockDatabaseMockRecorder) RemoteColumnTypes(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "RemoteColumnTypes", reflect.TypeOf((*MockDatabase)(nil).RemoteColumnTypes), arg0)
}
// RenameSchema mocks base method
func (_m *MockDatabase) RenameSchema(_param0 string, _param1 string, _param2 string) error {
ret := _m.ctrl.Call(_m, "RenameSchema", _param0, _param1, _param2)
ret0, _ := ret[0].(error)
return ret0
}
// RenameSchema indicates an expected call of RenameSchema
func (_mr *MockDatabaseMockRecorder) RenameSchema(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "RenameSchema", reflect.TypeOf((*MockDatabase)(nil).RenameSchema), arg0, arg1, arg2)
}
// Save mocks base method
func (_m *MockDatabase) Save(_param0 *skydb.Record) error {
ret := _m.ctrl.Call(_m, "Save", _param0)
ret0, _ := ret[0].(error)
return ret0
}
// Save indicates an expected call of Save
func (_mr *MockDatabaseMockRecorder) Save(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Save", reflect.TypeOf((*MockDatabase)(nil).Save), arg0)
}
// SaveIndex mocks base method
func (_m *MockDatabase) SaveIndex(_param0 string, _param1 string, _param2 skydb.Index) error {
ret := _m.ctrl.Call(_m, "SaveIndex", _param0, _param1, _param2)
ret0, _ := ret[0].(error)
return ret0
}
// SaveIndex indicates an expected call of SaveIndex
func (_mr *MockDatabaseMockRecorder) SaveIndex(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "SaveIndex", reflect.TypeOf((*MockDatabase)(nil).SaveIndex), arg0, arg1, arg2)
}
// SaveSubscription mocks base method
func (_m *MockDatabase) SaveSubscription(_param0 *skydb.Subscription) error {
ret := _m.ctrl.Call(_m, "SaveSubscription", _param0)
ret0, _ := ret[0].(error)
return ret0
}
// SaveSubscription indicates an expected call of SaveSubscription
func (_mr *MockDatabaseMockRecorder) SaveSubscription(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "SaveSubscription", reflect.TypeOf((*MockDatabase)(nil).SaveSubscription), arg0)
}
// TableName mocks base method
func (_m *MockDatabase) TableName(_param0 string) string {
ret := _m.ctrl.Call(_m, "TableName", _param0)
ret0, _ := ret[0].(string)
return ret0
}
// TableName indicates an expected call of TableName
func (_mr *MockDatabaseMockRecorder) TableName(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "TableName", reflect.TypeOf((*MockDatabase)(nil).TableName), arg0)
}
// UserRecordType mocks base method
func (_m *MockDatabase) UserRecordType() string {
ret := _m.ctrl.Call(_m, "UserRecordType")
ret0, _ := ret[0].(string)
return ret0
}
// UserRecordType indicates an expected call of UserRecordType
func (_mr *MockDatabaseMockRecorder) UserRecordType() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "UserRecordType", reflect.TypeOf((*MockDatabase)(nil).UserRecordType))
}