-
Notifications
You must be signed in to change notification settings - Fork 267
/
mock_datasource_manager.go
272 lines (232 loc) · 10.3 KB
/
mock_datasource_manager.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
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: datasource_manager.go
// Package mock is a generated GoMock package.
package mock
import (
context "context"
sql "database/sql"
reflect "reflect"
sync "sync"
gomock "github.com/golang/mock/gomock"
datasource "github.com/seata/seata-go/pkg/datasource/sql/datasource"
types "github.com/seata/seata-go/pkg/datasource/sql/types"
branch "github.com/seata/seata-go/pkg/protocol/branch"
rm "github.com/seata/seata-go/pkg/rm"
)
// MockDataSourceManager is a mock of DataSourceManager interface.
type MockDataSourceManager struct {
ctrl *gomock.Controller
recorder *MockDataSourceManagerMockRecorder
branchType branch.BranchType
}
// MockDataSourceManagerMockRecorder is the mock recorder for MockDataSourceManager.
type MockDataSourceManagerMockRecorder struct {
mock *MockDataSourceManager
}
// NewMockDataSourceManager creates a new mock instance.
func NewMockDataSourceManager(ctrl *gomock.Controller) *MockDataSourceManager {
mock := &MockDataSourceManager{ctrl: ctrl}
mock.recorder = &MockDataSourceManagerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockDataSourceManager) EXPECT() *MockDataSourceManagerMockRecorder {
return m.recorder
}
// BranchCommit mocks base method.
func (m *MockDataSourceManager) BranchCommit(ctx context.Context, resource rm.BranchResource) (branch.BranchStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BranchCommit", ctx, resource)
ret0, _ := ret[0].(branch.BranchStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BranchCommit indicates an expected call of BranchCommit.
func (mr *MockDataSourceManagerMockRecorder) BranchCommit(ctx, resource interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchCommit", reflect.TypeOf((*MockDataSourceManager)(nil).BranchCommit), ctx, resource)
}
// BranchRegister mocks base method.
func (m *MockDataSourceManager) BranchRegister(ctx context.Context, param rm.BranchRegisterParam) (int64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BranchRegister", ctx, param)
ret0, _ := ret[0].(int64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BranchRegister indicates an expected call of BranchRegister.
func (mr *MockDataSourceManagerMockRecorder) BranchRegister(ctx, param interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchRegister", reflect.TypeOf((*MockDataSourceManager)(nil).BranchRegister), ctx, param)
}
// BranchReport mocks base method.
func (m *MockDataSourceManager) BranchReport(ctx context.Context, param rm.BranchReportParam) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BranchReport", ctx, param)
ret0, _ := ret[0].(error)
return ret0
}
// BranchReport indicates an expected call of BranchReport.
func (mr *MockDataSourceManagerMockRecorder) BranchReport(ctx, param interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchReport", reflect.TypeOf((*MockDataSourceManager)(nil).BranchReport), ctx, param)
}
// BranchRollback mocks base method.
func (m *MockDataSourceManager) BranchRollback(ctx context.Context, resource rm.BranchResource) (branch.BranchStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BranchRollback", ctx, resource)
ret0, _ := ret[0].(branch.BranchStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BranchRollback indicates an expected call of BranchRollback.
func (mr *MockDataSourceManagerMockRecorder) BranchRollback(ctx, resource interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchRollback", reflect.TypeOf((*MockDataSourceManager)(nil).BranchRollback), ctx, resource)
}
// CreateTableMetaCache mocks base method.
func (m *MockDataSourceManager) CreateTableMetaCache(ctx context.Context, resID string, dbType types.DBType, db *sql.DB) (datasource.TableMetaCache, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateTableMetaCache", ctx, resID, dbType, db)
ret0, _ := ret[0].(datasource.TableMetaCache)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateTableMetaCache indicates an expected call of CreateTableMetaCache.
func (mr *MockDataSourceManagerMockRecorder) CreateTableMetaCache(ctx, resID, dbType, db interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTableMetaCache", reflect.TypeOf((*MockDataSourceManager)(nil).CreateTableMetaCache), ctx, resID, dbType, db)
}
func (m *MockDataSourceManager) SetBranchType(branchType branch.BranchType) {
m.branchType = branchType
}
// GetBranchType mocks base method.
func (m *MockDataSourceManager) GetBranchType() branch.BranchType {
return m.branchType
}
// GetBranchType indicates an expected call of GetBranchType.
func (mr *MockDataSourceManagerMockRecorder) GetBranchType() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBranchType", reflect.TypeOf((*MockDataSourceManager)(nil).GetBranchType))
}
// GetCachedResources mocks base method.
func (m *MockDataSourceManager) GetCachedResources() *sync.Map {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCachedResources")
ret0, _ := ret[0].(*sync.Map)
return ret0
}
// GetCachedResources indicates an expected call of GetCachedResources.
func (mr *MockDataSourceManagerMockRecorder) GetCachedResources() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCachedResources", reflect.TypeOf((*MockDataSourceManager)(nil).GetCachedResources))
}
// LockQuery mocks base method.
func (m *MockDataSourceManager) LockQuery(ctx context.Context, param rm.LockQueryParam) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LockQuery", ctx, param)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LockQuery indicates an expected call of LockQuery.
func (mr *MockDataSourceManagerMockRecorder) LockQuery(ctx, param interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockQuery", reflect.TypeOf((*MockDataSourceManager)(nil).LockQuery), ctx, param)
}
// RegisterResource mocks base method.
func (m *MockDataSourceManager) RegisterResource(resource rm.Resource) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RegisterResource", resource)
ret0, _ := ret[0].(error)
return ret0
}
// RegisterResource indicates an expected call of RegisterResource.
func (mr *MockDataSourceManagerMockRecorder) RegisterResource(resource interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterResource", reflect.TypeOf((*MockDataSourceManager)(nil).RegisterResource), resource)
}
// UnregisterResource mocks base method.
func (m *MockDataSourceManager) UnregisterResource(resource rm.Resource) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UnregisterResource", resource)
ret0, _ := ret[0].(error)
return ret0
}
// UnregisterResource indicates an expected call of UnregisterResource.
func (mr *MockDataSourceManagerMockRecorder) UnregisterResource(resource interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterResource", reflect.TypeOf((*MockDataSourceManager)(nil).UnregisterResource), resource)
}
// MockTableMetaCache is a mock of TableMetaCache interface.
type MockTableMetaCache struct {
ctrl *gomock.Controller
recorder *MockTableMetaCacheMockRecorder
}
// MockTableMetaCacheMockRecorder is the mock recorder for MockTableMetaCache.
type MockTableMetaCacheMockRecorder struct {
mock *MockTableMetaCache
}
// NewMockTableMetaCache creates a new mock instance.
func NewMockTableMetaCache(ctrl *gomock.Controller) *MockTableMetaCache {
mock := &MockTableMetaCache{ctrl: ctrl}
mock.recorder = &MockTableMetaCacheMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTableMetaCache) EXPECT() *MockTableMetaCacheMockRecorder {
return m.recorder
}
// Destroy mocks base method.
func (m *MockTableMetaCache) Destroy() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Destroy")
ret0, _ := ret[0].(error)
return ret0
}
// Destroy indicates an expected call of Destroy.
func (mr *MockTableMetaCacheMockRecorder) Destroy() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Destroy", reflect.TypeOf((*MockTableMetaCache)(nil).Destroy))
}
// GetTableMeta mocks base method.
func (m *MockTableMetaCache) GetTableMeta(ctx context.Context, dbName, table string) (*types.TableMeta, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTableMeta", ctx, dbName, table)
ret0, _ := ret[0].(*types.TableMeta)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetTableMeta indicates an expected call of GetTableMeta.
func (mr *MockTableMetaCacheMockRecorder) GetTableMeta(ctx, dbName, table interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTableMeta", reflect.TypeOf((*MockTableMetaCache)(nil).GetTableMeta), ctx, dbName, table)
}
// Init mocks base method.
func (m *MockTableMetaCache) Init(ctx context.Context, conn *sql.DB) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Init", ctx, conn)
ret0, _ := ret[0].(error)
return ret0
}
// Init indicates an expected call of Init.
func (mr *MockTableMetaCacheMockRecorder) Init(ctx, conn interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockTableMetaCache)(nil).Init), ctx, conn)
}