github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/pkg/etcd/mock/etcd_client_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: pkg/etcd/etcd.go 3 4 // Package mock_etcd is a generated GoMock package. 5 package mock_etcd 6 7 import ( 8 context "context" 9 reflect "reflect" 10 11 gomock "github.com/golang/mock/gomock" 12 model "github.com/pingcap/tiflow/cdc/model" 13 etcd "github.com/pingcap/tiflow/pkg/etcd" 14 mvccpb "go.etcd.io/etcd/api/v3/mvccpb" 15 clientv3 "go.etcd.io/etcd/client/v3" 16 ) 17 18 // MockOwnerCaptureInfoClient is a mock of OwnerCaptureInfoClient interface. 19 type MockOwnerCaptureInfoClient struct { 20 ctrl *gomock.Controller 21 recorder *MockOwnerCaptureInfoClientMockRecorder 22 } 23 24 // MockOwnerCaptureInfoClientMockRecorder is the mock recorder for MockOwnerCaptureInfoClient. 25 type MockOwnerCaptureInfoClientMockRecorder struct { 26 mock *MockOwnerCaptureInfoClient 27 } 28 29 // NewMockOwnerCaptureInfoClient creates a new mock instance. 30 func NewMockOwnerCaptureInfoClient(ctrl *gomock.Controller) *MockOwnerCaptureInfoClient { 31 mock := &MockOwnerCaptureInfoClient{ctrl: ctrl} 32 mock.recorder = &MockOwnerCaptureInfoClientMockRecorder{mock} 33 return mock 34 } 35 36 // EXPECT returns an object that allows the caller to indicate expected use. 37 func (m *MockOwnerCaptureInfoClient) EXPECT() *MockOwnerCaptureInfoClientMockRecorder { 38 return m.recorder 39 } 40 41 // GetCaptures mocks base method. 42 func (m *MockOwnerCaptureInfoClient) GetCaptures(arg0 context.Context) (int64, []*model.CaptureInfo, error) { 43 m.ctrl.T.Helper() 44 ret := m.ctrl.Call(m, "GetCaptures", arg0) 45 ret0, _ := ret[0].(int64) 46 ret1, _ := ret[1].([]*model.CaptureInfo) 47 ret2, _ := ret[2].(error) 48 return ret0, ret1, ret2 49 } 50 51 // GetCaptures indicates an expected call of GetCaptures. 52 func (mr *MockOwnerCaptureInfoClientMockRecorder) GetCaptures(arg0 interface{}) *gomock.Call { 53 mr.mock.ctrl.T.Helper() 54 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCaptures", reflect.TypeOf((*MockOwnerCaptureInfoClient)(nil).GetCaptures), arg0) 55 } 56 57 // GetOwnerID mocks base method. 58 func (m *MockOwnerCaptureInfoClient) GetOwnerID(arg0 context.Context) (model.CaptureID, error) { 59 m.ctrl.T.Helper() 60 ret := m.ctrl.Call(m, "GetOwnerID", arg0) 61 ret0, _ := ret[0].(model.CaptureID) 62 ret1, _ := ret[1].(error) 63 return ret0, ret1 64 } 65 66 // GetOwnerID indicates an expected call of GetOwnerID. 67 func (mr *MockOwnerCaptureInfoClientMockRecorder) GetOwnerID(arg0 interface{}) *gomock.Call { 68 mr.mock.ctrl.T.Helper() 69 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOwnerID", reflect.TypeOf((*MockOwnerCaptureInfoClient)(nil).GetOwnerID), arg0) 70 } 71 72 // GetOwnerRevision mocks base method. 73 func (m *MockOwnerCaptureInfoClient) GetOwnerRevision(arg0 context.Context, arg1 model.CaptureID) (int64, error) { 74 m.ctrl.T.Helper() 75 ret := m.ctrl.Call(m, "GetOwnerRevision", arg0, arg1) 76 ret0, _ := ret[0].(int64) 77 ret1, _ := ret[1].(error) 78 return ret0, ret1 79 } 80 81 // GetOwnerRevision indicates an expected call of GetOwnerRevision. 82 func (mr *MockOwnerCaptureInfoClientMockRecorder) GetOwnerRevision(arg0, arg1 interface{}) *gomock.Call { 83 mr.mock.ctrl.T.Helper() 84 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOwnerRevision", reflect.TypeOf((*MockOwnerCaptureInfoClient)(nil).GetOwnerRevision), arg0, arg1) 85 } 86 87 // MockCDCEtcdClient is a mock of CDCEtcdClient interface. 88 type MockCDCEtcdClient struct { 89 ctrl *gomock.Controller 90 recorder *MockCDCEtcdClientMockRecorder 91 } 92 93 // MockCDCEtcdClientMockRecorder is the mock recorder for MockCDCEtcdClient. 94 type MockCDCEtcdClientMockRecorder struct { 95 mock *MockCDCEtcdClient 96 } 97 98 // NewMockCDCEtcdClient creates a new mock instance. 99 func NewMockCDCEtcdClient(ctrl *gomock.Controller) *MockCDCEtcdClient { 100 mock := &MockCDCEtcdClient{ctrl: ctrl} 101 mock.recorder = &MockCDCEtcdClientMockRecorder{mock} 102 return mock 103 } 104 105 // EXPECT returns an object that allows the caller to indicate expected use. 106 func (m *MockCDCEtcdClient) EXPECT() *MockCDCEtcdClientMockRecorder { 107 return m.recorder 108 } 109 110 // CheckMultipleCDCClusterExist mocks base method. 111 func (m *MockCDCEtcdClient) CheckMultipleCDCClusterExist(ctx context.Context) error { 112 m.ctrl.T.Helper() 113 ret := m.ctrl.Call(m, "CheckMultipleCDCClusterExist", ctx) 114 ret0, _ := ret[0].(error) 115 return ret0 116 } 117 118 // CheckMultipleCDCClusterExist indicates an expected call of CheckMultipleCDCClusterExist. 119 func (mr *MockCDCEtcdClientMockRecorder) CheckMultipleCDCClusterExist(ctx interface{}) *gomock.Call { 120 mr.mock.ctrl.T.Helper() 121 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckMultipleCDCClusterExist", reflect.TypeOf((*MockCDCEtcdClient)(nil).CheckMultipleCDCClusterExist), ctx) 122 } 123 124 // CreateChangefeedInfo mocks base method. 125 func (m *MockCDCEtcdClient) CreateChangefeedInfo(arg0 context.Context, arg1 *model.UpstreamInfo, arg2 *model.ChangeFeedInfo) error { 126 m.ctrl.T.Helper() 127 ret := m.ctrl.Call(m, "CreateChangefeedInfo", arg0, arg1, arg2) 128 ret0, _ := ret[0].(error) 129 return ret0 130 } 131 132 // CreateChangefeedInfo indicates an expected call of CreateChangefeedInfo. 133 func (mr *MockCDCEtcdClientMockRecorder) CreateChangefeedInfo(arg0, arg1, arg2 interface{}) *gomock.Call { 134 mr.mock.ctrl.T.Helper() 135 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateChangefeedInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).CreateChangefeedInfo), arg0, arg1, arg2) 136 } 137 138 // DeleteCaptureInfo mocks base method. 139 func (m *MockCDCEtcdClient) DeleteCaptureInfo(arg0 context.Context, arg1 model.CaptureID) error { 140 m.ctrl.T.Helper() 141 ret := m.ctrl.Call(m, "DeleteCaptureInfo", arg0, arg1) 142 ret0, _ := ret[0].(error) 143 return ret0 144 } 145 146 // DeleteCaptureInfo indicates an expected call of DeleteCaptureInfo. 147 func (mr *MockCDCEtcdClientMockRecorder) DeleteCaptureInfo(arg0, arg1 interface{}) *gomock.Call { 148 mr.mock.ctrl.T.Helper() 149 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCaptureInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).DeleteCaptureInfo), arg0, arg1) 150 } 151 152 // GetAllCDCInfo mocks base method. 153 func (m *MockCDCEtcdClient) GetAllCDCInfo(ctx context.Context) ([]*mvccpb.KeyValue, error) { 154 m.ctrl.T.Helper() 155 ret := m.ctrl.Call(m, "GetAllCDCInfo", ctx) 156 ret0, _ := ret[0].([]*mvccpb.KeyValue) 157 ret1, _ := ret[1].(error) 158 return ret0, ret1 159 } 160 161 // GetAllCDCInfo indicates an expected call of GetAllCDCInfo. 162 func (mr *MockCDCEtcdClientMockRecorder) GetAllCDCInfo(ctx interface{}) *gomock.Call { 163 mr.mock.ctrl.T.Helper() 164 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllCDCInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetAllCDCInfo), ctx) 165 } 166 167 // GetAllChangeFeedInfo mocks base method. 168 func (m *MockCDCEtcdClient) GetAllChangeFeedInfo(ctx context.Context) (map[model.ChangeFeedID]*model.ChangeFeedInfo, error) { 169 m.ctrl.T.Helper() 170 ret := m.ctrl.Call(m, "GetAllChangeFeedInfo", ctx) 171 ret0, _ := ret[0].(map[model.ChangeFeedID]*model.ChangeFeedInfo) 172 ret1, _ := ret[1].(error) 173 return ret0, ret1 174 } 175 176 // GetAllChangeFeedInfo indicates an expected call of GetAllChangeFeedInfo. 177 func (mr *MockCDCEtcdClientMockRecorder) GetAllChangeFeedInfo(ctx interface{}) *gomock.Call { 178 mr.mock.ctrl.T.Helper() 179 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllChangeFeedInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetAllChangeFeedInfo), ctx) 180 } 181 182 // GetCaptures mocks base method. 183 func (m *MockCDCEtcdClient) GetCaptures(arg0 context.Context) (int64, []*model.CaptureInfo, error) { 184 m.ctrl.T.Helper() 185 ret := m.ctrl.Call(m, "GetCaptures", arg0) 186 ret0, _ := ret[0].(int64) 187 ret1, _ := ret[1].([]*model.CaptureInfo) 188 ret2, _ := ret[2].(error) 189 return ret0, ret1, ret2 190 } 191 192 // GetCaptures indicates an expected call of GetCaptures. 193 func (mr *MockCDCEtcdClientMockRecorder) GetCaptures(arg0 interface{}) *gomock.Call { 194 mr.mock.ctrl.T.Helper() 195 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCaptures", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetCaptures), arg0) 196 } 197 198 // GetChangeFeedInfo mocks base method. 199 func (m *MockCDCEtcdClient) GetChangeFeedInfo(ctx context.Context, id model.ChangeFeedID) (*model.ChangeFeedInfo, error) { 200 m.ctrl.T.Helper() 201 ret := m.ctrl.Call(m, "GetChangeFeedInfo", ctx, id) 202 ret0, _ := ret[0].(*model.ChangeFeedInfo) 203 ret1, _ := ret[1].(error) 204 return ret0, ret1 205 } 206 207 // GetChangeFeedInfo indicates an expected call of GetChangeFeedInfo. 208 func (mr *MockCDCEtcdClientMockRecorder) GetChangeFeedInfo(ctx, id interface{}) *gomock.Call { 209 mr.mock.ctrl.T.Helper() 210 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangeFeedInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetChangeFeedInfo), ctx, id) 211 } 212 213 // GetChangeFeedStatus mocks base method. 214 func (m *MockCDCEtcdClient) GetChangeFeedStatus(ctx context.Context, id model.ChangeFeedID) (*model.ChangeFeedStatus, int64, error) { 215 m.ctrl.T.Helper() 216 ret := m.ctrl.Call(m, "GetChangeFeedStatus", ctx, id) 217 ret0, _ := ret[0].(*model.ChangeFeedStatus) 218 ret1, _ := ret[1].(int64) 219 ret2, _ := ret[2].(error) 220 return ret0, ret1, ret2 221 } 222 223 // GetChangeFeedStatus indicates an expected call of GetChangeFeedStatus. 224 func (mr *MockCDCEtcdClientMockRecorder) GetChangeFeedStatus(ctx, id interface{}) *gomock.Call { 225 mr.mock.ctrl.T.Helper() 226 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangeFeedStatus", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetChangeFeedStatus), ctx, id) 227 } 228 229 // GetClusterID mocks base method. 230 func (m *MockCDCEtcdClient) GetClusterID() string { 231 m.ctrl.T.Helper() 232 ret := m.ctrl.Call(m, "GetClusterID") 233 ret0, _ := ret[0].(string) 234 return ret0 235 } 236 237 // GetClusterID indicates an expected call of GetClusterID. 238 func (mr *MockCDCEtcdClientMockRecorder) GetClusterID() *gomock.Call { 239 mr.mock.ctrl.T.Helper() 240 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterID", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetClusterID)) 241 } 242 243 // GetEnsureGCServiceID mocks base method. 244 func (m *MockCDCEtcdClient) GetEnsureGCServiceID(tag string) string { 245 m.ctrl.T.Helper() 246 ret := m.ctrl.Call(m, "GetEnsureGCServiceID", tag) 247 ret0, _ := ret[0].(string) 248 return ret0 249 } 250 251 // GetEnsureGCServiceID indicates an expected call of GetEnsureGCServiceID. 252 func (mr *MockCDCEtcdClientMockRecorder) GetEnsureGCServiceID(tag interface{}) *gomock.Call { 253 mr.mock.ctrl.T.Helper() 254 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnsureGCServiceID", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetEnsureGCServiceID), tag) 255 } 256 257 // GetEtcdClient mocks base method. 258 func (m *MockCDCEtcdClient) GetEtcdClient() *etcd.Client { 259 m.ctrl.T.Helper() 260 ret := m.ctrl.Call(m, "GetEtcdClient") 261 ret0, _ := ret[0].(*etcd.Client) 262 return ret0 263 } 264 265 // GetEtcdClient indicates an expected call of GetEtcdClient. 266 func (mr *MockCDCEtcdClientMockRecorder) GetEtcdClient() *gomock.Call { 267 mr.mock.ctrl.T.Helper() 268 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEtcdClient", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetEtcdClient)) 269 } 270 271 // GetGCServiceID mocks base method. 272 func (m *MockCDCEtcdClient) GetGCServiceID() string { 273 m.ctrl.T.Helper() 274 ret := m.ctrl.Call(m, "GetGCServiceID") 275 ret0, _ := ret[0].(string) 276 return ret0 277 } 278 279 // GetGCServiceID indicates an expected call of GetGCServiceID. 280 func (mr *MockCDCEtcdClientMockRecorder) GetGCServiceID() *gomock.Call { 281 mr.mock.ctrl.T.Helper() 282 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGCServiceID", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetGCServiceID)) 283 } 284 285 // GetOwnerID mocks base method. 286 func (m *MockCDCEtcdClient) GetOwnerID(arg0 context.Context) (model.CaptureID, error) { 287 m.ctrl.T.Helper() 288 ret := m.ctrl.Call(m, "GetOwnerID", arg0) 289 ret0, _ := ret[0].(model.CaptureID) 290 ret1, _ := ret[1].(error) 291 return ret0, ret1 292 } 293 294 // GetOwnerID indicates an expected call of GetOwnerID. 295 func (mr *MockCDCEtcdClientMockRecorder) GetOwnerID(arg0 interface{}) *gomock.Call { 296 mr.mock.ctrl.T.Helper() 297 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOwnerID", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetOwnerID), arg0) 298 } 299 300 // GetOwnerRevision mocks base method. 301 func (m *MockCDCEtcdClient) GetOwnerRevision(arg0 context.Context, arg1 model.CaptureID) (int64, error) { 302 m.ctrl.T.Helper() 303 ret := m.ctrl.Call(m, "GetOwnerRevision", arg0, arg1) 304 ret0, _ := ret[0].(int64) 305 ret1, _ := ret[1].(error) 306 return ret0, ret1 307 } 308 309 // GetOwnerRevision indicates an expected call of GetOwnerRevision. 310 func (mr *MockCDCEtcdClientMockRecorder) GetOwnerRevision(arg0, arg1 interface{}) *gomock.Call { 311 mr.mock.ctrl.T.Helper() 312 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOwnerRevision", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetOwnerRevision), arg0, arg1) 313 } 314 315 // GetUpstreamInfo mocks base method. 316 func (m *MockCDCEtcdClient) GetUpstreamInfo(ctx context.Context, upstreamID model.UpstreamID, namespace string) (*model.UpstreamInfo, error) { 317 m.ctrl.T.Helper() 318 ret := m.ctrl.Call(m, "GetUpstreamInfo", ctx, upstreamID, namespace) 319 ret0, _ := ret[0].(*model.UpstreamInfo) 320 ret1, _ := ret[1].(error) 321 return ret0, ret1 322 } 323 324 // GetUpstreamInfo indicates an expected call of GetUpstreamInfo. 325 func (mr *MockCDCEtcdClientMockRecorder) GetUpstreamInfo(ctx, upstreamID, namespace interface{}) *gomock.Call { 326 mr.mock.ctrl.T.Helper() 327 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUpstreamInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).GetUpstreamInfo), ctx, upstreamID, namespace) 328 } 329 330 // PutCaptureInfo mocks base method. 331 func (m *MockCDCEtcdClient) PutCaptureInfo(arg0 context.Context, arg1 *model.CaptureInfo, arg2 clientv3.LeaseID) error { 332 m.ctrl.T.Helper() 333 ret := m.ctrl.Call(m, "PutCaptureInfo", arg0, arg1, arg2) 334 ret0, _ := ret[0].(error) 335 return ret0 336 } 337 338 // PutCaptureInfo indicates an expected call of PutCaptureInfo. 339 func (mr *MockCDCEtcdClientMockRecorder) PutCaptureInfo(arg0, arg1, arg2 interface{}) *gomock.Call { 340 mr.mock.ctrl.T.Helper() 341 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCaptureInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).PutCaptureInfo), arg0, arg1, arg2) 342 } 343 344 // SaveChangeFeedInfo mocks base method. 345 func (m *MockCDCEtcdClient) SaveChangeFeedInfo(ctx context.Context, info *model.ChangeFeedInfo, changeFeedID model.ChangeFeedID) error { 346 m.ctrl.T.Helper() 347 ret := m.ctrl.Call(m, "SaveChangeFeedInfo", ctx, info, changeFeedID) 348 ret0, _ := ret[0].(error) 349 return ret0 350 } 351 352 // SaveChangeFeedInfo indicates an expected call of SaveChangeFeedInfo. 353 func (mr *MockCDCEtcdClientMockRecorder) SaveChangeFeedInfo(ctx, info, changeFeedID interface{}) *gomock.Call { 354 mr.mock.ctrl.T.Helper() 355 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveChangeFeedInfo", reflect.TypeOf((*MockCDCEtcdClient)(nil).SaveChangeFeedInfo), ctx, info, changeFeedID) 356 } 357 358 // UpdateChangefeedAndUpstream mocks base method. 359 func (m *MockCDCEtcdClient) UpdateChangefeedAndUpstream(ctx context.Context, upstreamInfo *model.UpstreamInfo, changeFeedInfo *model.ChangeFeedInfo) error { 360 m.ctrl.T.Helper() 361 ret := m.ctrl.Call(m, "UpdateChangefeedAndUpstream", ctx, upstreamInfo, changeFeedInfo) 362 ret0, _ := ret[0].(error) 363 return ret0 364 } 365 366 // UpdateChangefeedAndUpstream indicates an expected call of UpdateChangefeedAndUpstream. 367 func (mr *MockCDCEtcdClientMockRecorder) UpdateChangefeedAndUpstream(ctx, upstreamInfo, changeFeedInfo interface{}) *gomock.Call { 368 mr.mock.ctrl.T.Helper() 369 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateChangefeedAndUpstream", reflect.TypeOf((*MockCDCEtcdClient)(nil).UpdateChangefeedAndUpstream), ctx, upstreamInfo, changeFeedInfo) 370 }