github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/pkg/election/mock/elector_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: github.com/pingcap/tiflow/pkg/election (interfaces: Elector) 3 4 // Package mock is a generated GoMock package. 5 package mock 6 7 import ( 8 context "context" 9 reflect "reflect" 10 time "time" 11 12 gomock "github.com/golang/mock/gomock" 13 election "github.com/pingcap/tiflow/pkg/election" 14 ) 15 16 // MockElector is a mock of Elector interface. 17 type MockElector struct { 18 ctrl *gomock.Controller 19 recorder *MockElectorMockRecorder 20 } 21 22 // MockElectorMockRecorder is the mock recorder for MockElector. 23 type MockElectorMockRecorder struct { 24 mock *MockElector 25 } 26 27 // NewMockElector creates a new mock instance. 28 func NewMockElector(ctrl *gomock.Controller) *MockElector { 29 mock := &MockElector{ctrl: ctrl} 30 mock.recorder = &MockElectorMockRecorder{mock} 31 return mock 32 } 33 34 // EXPECT returns an object that allows the caller to indicate expected use. 35 func (m *MockElector) EXPECT() *MockElectorMockRecorder { 36 return m.recorder 37 } 38 39 // GetLeader mocks base method. 40 func (m *MockElector) GetLeader() (*election.Member, bool) { 41 m.ctrl.T.Helper() 42 ret := m.ctrl.Call(m, "GetLeader") 43 ret0, _ := ret[0].(*election.Member) 44 ret1, _ := ret[1].(bool) 45 return ret0, ret1 46 } 47 48 // GetLeader indicates an expected call of GetLeader. 49 func (mr *MockElectorMockRecorder) GetLeader() *gomock.Call { 50 mr.mock.ctrl.T.Helper() 51 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLeader", reflect.TypeOf((*MockElector)(nil).GetLeader)) 52 } 53 54 // GetMembers mocks base method. 55 func (m *MockElector) GetMembers() []*election.Member { 56 m.ctrl.T.Helper() 57 ret := m.ctrl.Call(m, "GetMembers") 58 ret0, _ := ret[0].([]*election.Member) 59 return ret0 60 } 61 62 // GetMembers indicates an expected call of GetMembers. 63 func (mr *MockElectorMockRecorder) GetMembers() *gomock.Call { 64 mr.mock.ctrl.T.Helper() 65 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMembers", reflect.TypeOf((*MockElector)(nil).GetMembers)) 66 } 67 68 // IsLeader mocks base method. 69 func (m *MockElector) IsLeader() bool { 70 m.ctrl.T.Helper() 71 ret := m.ctrl.Call(m, "IsLeader") 72 ret0, _ := ret[0].(bool) 73 return ret0 74 } 75 76 // IsLeader indicates an expected call of IsLeader. 77 func (mr *MockElectorMockRecorder) IsLeader() *gomock.Call { 78 mr.mock.ctrl.T.Helper() 79 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsLeader", reflect.TypeOf((*MockElector)(nil).IsLeader)) 80 } 81 82 // ResignLeader mocks base method. 83 func (m *MockElector) ResignLeader(arg0 context.Context, arg1 time.Duration) error { 84 m.ctrl.T.Helper() 85 ret := m.ctrl.Call(m, "ResignLeader", arg0, arg1) 86 ret0, _ := ret[0].(error) 87 return ret0 88 } 89 90 // ResignLeader indicates an expected call of ResignLeader. 91 func (mr *MockElectorMockRecorder) ResignLeader(arg0, arg1 interface{}) *gomock.Call { 92 mr.mock.ctrl.T.Helper() 93 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResignLeader", reflect.TypeOf((*MockElector)(nil).ResignLeader), arg0, arg1) 94 } 95 96 // RunElection mocks base method. 97 func (m *MockElector) RunElection(arg0 context.Context) error { 98 m.ctrl.T.Helper() 99 ret := m.ctrl.Call(m, "RunElection", arg0) 100 ret0, _ := ret[0].(error) 101 return ret0 102 } 103 104 // RunElection indicates an expected call of RunElection. 105 func (mr *MockElectorMockRecorder) RunElection(arg0 interface{}) *gomock.Call { 106 mr.mock.ctrl.T.Helper() 107 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunElection", reflect.TypeOf((*MockElector)(nil).RunElection), arg0) 108 }