github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/pkg/sink/kafka/v2/mock/writer_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: pkg/sink/kafka/v2/writer.go 3 4 // Package mock_v2 is a generated GoMock package. 5 package mock_v2 6 7 import ( 8 context "context" 9 reflect "reflect" 10 11 gomock "github.com/golang/mock/gomock" 12 kafka "github.com/segmentio/kafka-go" 13 ) 14 15 // MockWriter is a mock of Writer interface. 16 type MockWriter struct { 17 ctrl *gomock.Controller 18 recorder *MockWriterMockRecorder 19 } 20 21 // MockWriterMockRecorder is the mock recorder for MockWriter. 22 type MockWriterMockRecorder struct { 23 mock *MockWriter 24 } 25 26 // NewMockWriter creates a new mock instance. 27 func NewMockWriter(ctrl *gomock.Controller) *MockWriter { 28 mock := &MockWriter{ctrl: ctrl} 29 mock.recorder = &MockWriterMockRecorder{mock} 30 return mock 31 } 32 33 // EXPECT returns an object that allows the caller to indicate expected use. 34 func (m *MockWriter) EXPECT() *MockWriterMockRecorder { 35 return m.recorder 36 } 37 38 // Close mocks base method. 39 func (m *MockWriter) Close() error { 40 m.ctrl.T.Helper() 41 ret := m.ctrl.Call(m, "Close") 42 ret0, _ := ret[0].(error) 43 return ret0 44 } 45 46 // Close indicates an expected call of Close. 47 func (mr *MockWriterMockRecorder) Close() *gomock.Call { 48 mr.mock.ctrl.T.Helper() 49 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockWriter)(nil).Close)) 50 } 51 52 // Stats mocks base method. 53 func (m *MockWriter) Stats() kafka.WriterStats { 54 m.ctrl.T.Helper() 55 ret := m.ctrl.Call(m, "Stats") 56 ret0, _ := ret[0].(kafka.WriterStats) 57 return ret0 58 } 59 60 // Stats indicates an expected call of Stats. 61 func (mr *MockWriterMockRecorder) Stats() *gomock.Call { 62 mr.mock.ctrl.T.Helper() 63 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stats", reflect.TypeOf((*MockWriter)(nil).Stats)) 64 } 65 66 // WriteMessages mocks base method. 67 func (m *MockWriter) WriteMessages(ctx context.Context, msgs ...kafka.Message) error { 68 m.ctrl.T.Helper() 69 varargs := []interface{}{ctx} 70 for _, a := range msgs { 71 varargs = append(varargs, a) 72 } 73 ret := m.ctrl.Call(m, "WriteMessages", varargs...) 74 ret0, _ := ret[0].(error) 75 return ret0 76 } 77 78 // WriteMessages indicates an expected call of WriteMessages. 79 func (mr *MockWriterMockRecorder) WriteMessages(ctx interface{}, msgs ...interface{}) *gomock.Call { 80 mr.mock.ctrl.T.Helper() 81 varargs := append([]interface{}{ctx}, msgs...) 82 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteMessages", reflect.TypeOf((*MockWriter)(nil).WriteMessages), varargs...) 83 }