github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/wal/mocks/WAL.go (about) 1 // Code generated by mockery v2.31.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 wal "github.com/projecteru2/core/wal" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // WAL is an autogenerated mock type for the WAL type 13 type WAL struct { 14 mock.Mock 15 } 16 17 // Close provides a mock function with given fields: 18 func (_m *WAL) Close() error { 19 ret := _m.Called() 20 21 var r0 error 22 if rf, ok := ret.Get(0).(func() error); ok { 23 r0 = rf() 24 } else { 25 r0 = ret.Error(0) 26 } 27 28 return r0 29 } 30 31 // Log provides a mock function with given fields: _a0, _a1 32 func (_m *WAL) Log(_a0 string, _a1 interface{}) (wal.Commit, error) { 33 ret := _m.Called(_a0, _a1) 34 35 var r0 wal.Commit 36 var r1 error 37 if rf, ok := ret.Get(0).(func(string, interface{}) (wal.Commit, error)); ok { 38 return rf(_a0, _a1) 39 } 40 if rf, ok := ret.Get(0).(func(string, interface{}) wal.Commit); ok { 41 r0 = rf(_a0, _a1) 42 } else { 43 if ret.Get(0) != nil { 44 r0 = ret.Get(0).(wal.Commit) 45 } 46 } 47 48 if rf, ok := ret.Get(1).(func(string, interface{}) error); ok { 49 r1 = rf(_a0, _a1) 50 } else { 51 r1 = ret.Error(1) 52 } 53 54 return r0, r1 55 } 56 57 // Recover provides a mock function with given fields: _a0 58 func (_m *WAL) Recover(_a0 context.Context) { 59 _m.Called(_a0) 60 } 61 62 // Register provides a mock function with given fields: _a0 63 func (_m *WAL) Register(_a0 wal.EventHandler) { 64 _m.Called(_a0) 65 } 66 67 // NewWAL creates a new instance of WAL. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 68 // The first argument is typically a *testing.T value. 69 func NewWAL(t interface { 70 mock.TestingT 71 Cleanup(func()) 72 }) *WAL { 73 mock := &WAL{} 74 mock.Mock.Test(t) 75 76 t.Cleanup(func() { mock.AssertExpectations(t) }) 77 78 return mock 79 }