diff --git a/pkg/log/mocks/Service.go b/pkg/log/mocks/Service.go index efc07061bbba95e24757b1346ae4ff81cbca8a90..4038268ceb95c06985d1730b09cffbaee3fe8e03 100644 --- a/pkg/log/mocks/Service.go +++ b/pkg/log/mocks/Service.go @@ -16,14 +16,6 @@ type Service struct { mock.Mock } -type Service_Expecter struct { - mock *mock.Mock -} - -func (_m *Service) EXPECT() *Service_Expecter { - return &Service_Expecter{mock: &_m.Mock} -} - // Delete provides a mock function with given fields: ctx, filter func (_m *Service) Delete(ctx context.Context, filter *log.Filter) error { ret := _m.Called(ctx, filter) @@ -42,35 +34,6 @@ func (_m *Service) Delete(ctx context.Context, filter *log.Filter) error { return r0 } -// Service_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type Service_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - ctx context.Context -// - filter *log.Filter -func (_e *Service_Expecter) Delete(ctx interface{}, filter interface{}) *Service_Delete_Call { - return &Service_Delete_Call{Call: _e.mock.On("Delete", ctx, filter)} -} - -func (_c *Service_Delete_Call) Run(run func(ctx context.Context, filter *log.Filter)) *Service_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*log.Filter)) - }) - return _c -} - -func (_c *Service_Delete_Call) Return(_a0 error) *Service_Delete_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Service_Delete_Call) RunAndReturn(run func(context.Context, *log.Filter) error) *Service_Delete_Call { - _c.Call.Return(run) - return _c -} - // Find provides a mock function with given fields: ctx, filter, _a2 func (_m *Service) Find(ctx context.Context, filter *log.Filter, _a2 *options.FindOptions) (*log.FindResult, error) { ret := _m.Called(ctx, filter, _a2) @@ -101,38 +64,8 @@ func (_m *Service) Find(ctx context.Context, filter *log.Filter, _a2 *options.Fi return r0, r1 } -// Service_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' -type Service_Find_Call struct { - *mock.Call -} - -// Find is a helper method to define mock.On call -// - ctx context.Context -// - filter *log.Filter -// - _a2 *options.FindOptions -func (_e *Service_Expecter) Find(ctx interface{}, filter interface{}, _a2 interface{}) *Service_Find_Call { - return &Service_Find_Call{Call: _e.mock.On("Find", ctx, filter, _a2)} -} - -func (_c *Service_Find_Call) Run(run func(ctx context.Context, filter *log.Filter, _a2 *options.FindOptions)) *Service_Find_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*log.Filter), args[2].(*options.FindOptions)) - }) - return _c -} - -func (_c *Service_Find_Call) Return(_a0 *log.FindResult, _a1 error) *Service_Find_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Service_Find_Call) RunAndReturn(run func(context.Context, *log.Filter, *options.FindOptions) (*log.FindResult, error)) *Service_Find_Call { - _c.Call.Return(run) - return _c -} - // Log provides a mock function with given fields: ctx, entries -func (_m *Service) Log(ctx context.Context, entries <-chan *log.Entry) error { +func (_m *Service) Log(ctx context.Context, entries []*log.Entry) error { ret := _m.Called(ctx, entries) if len(ret) == 0 { @@ -140,7 +73,7 @@ func (_m *Service) Log(ctx context.Context, entries <-chan *log.Entry) error { } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, <-chan *log.Entry) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, []*log.Entry) error); ok { r0 = rf(ctx, entries) } else { r0 = ret.Error(0) @@ -149,82 +82,6 @@ func (_m *Service) Log(ctx context.Context, entries <-chan *log.Entry) error { return r0 } -// Service_Log_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Log' -type Service_Log_Call struct { - *mock.Call -} - -// Log is a helper method to define mock.On call -// - ctx context.Context -// - entries <-chan *log.Entry -func (_e *Service_Expecter) Log(ctx interface{}, entries interface{}) *Service_Log_Call { - return &Service_Log_Call{Call: _e.mock.On("Log", ctx, entries)} -} - -func (_c *Service_Log_Call) Run(run func(ctx context.Context, entries <-chan *log.Entry)) *Service_Log_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(<-chan *log.Entry)) - }) - return _c -} - -func (_c *Service_Log_Call) Return(_a0 error) *Service_Log_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Service_Log_Call) RunAndReturn(run func(context.Context, <-chan *log.Entry) error) *Service_Log_Call { - _c.Call.Return(run) - return _c -} - -// LogEntry provides a mock function with given fields: ctx, entry -func (_m *Service) LogEntry(ctx context.Context, entry *log.Entry) error { - ret := _m.Called(ctx, entry) - - if len(ret) == 0 { - panic("no return value specified for LogEntry") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *log.Entry) error); ok { - r0 = rf(ctx, entry) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Service_LogEntry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogEntry' -type Service_LogEntry_Call struct { - *mock.Call -} - -// LogEntry is a helper method to define mock.On call -// - ctx context.Context -// - entry *log.Entry -func (_e *Service_Expecter) LogEntry(ctx interface{}, entry interface{}) *Service_LogEntry_Call { - return &Service_LogEntry_Call{Call: _e.mock.On("LogEntry", ctx, entry)} -} - -func (_c *Service_LogEntry_Call) Run(run func(ctx context.Context, entry *log.Entry)) *Service_LogEntry_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*log.Entry)) - }) - return _c -} - -func (_c *Service_LogEntry_Call) Return(_a0 error) *Service_LogEntry_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Service_LogEntry_Call) RunAndReturn(run func(context.Context, *log.Entry) error) *Service_LogEntry_Call { - _c.Call.Return(run) - return _c -} - // NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewService(t interface { diff --git a/pkg/log/mocks/Storage.go b/pkg/log/mocks/Storage.go index 07646ee70c428b5fdf08a92d04f082fe5dda5a12..3b5a32f56c74091399b3fefdc0ba546f568f882a 100644 --- a/pkg/log/mocks/Storage.go +++ b/pkg/log/mocks/Storage.go @@ -16,14 +16,6 @@ type Storage struct { mock.Mock } -type Storage_Expecter struct { - mock *mock.Mock -} - -func (_m *Storage) EXPECT() *Storage_Expecter { - return &Storage_Expecter{mock: &_m.Mock} -} - // Delete provides a mock function with given fields: ctx, filter func (_m *Storage) Delete(ctx context.Context, filter *log.Filter) error { ret := _m.Called(ctx, filter) @@ -42,35 +34,6 @@ func (_m *Storage) Delete(ctx context.Context, filter *log.Filter) error { return r0 } -// Storage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type Storage_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - ctx context.Context -// - filter *log.Filter -func (_e *Storage_Expecter) Delete(ctx interface{}, filter interface{}) *Storage_Delete_Call { - return &Storage_Delete_Call{Call: _e.mock.On("Delete", ctx, filter)} -} - -func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, filter *log.Filter)) *Storage_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*log.Filter)) - }) - return _c -} - -func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Storage_Delete_Call) RunAndReturn(run func(context.Context, *log.Filter) error) *Storage_Delete_Call { - _c.Call.Return(run) - return _c -} - // Find provides a mock function with given fields: ctx, filter, _a2 func (_m *Storage) Find(ctx context.Context, filter *log.Filter, _a2 *options.FindOptions) ([]*log.Entry, int, error) { ret := _m.Called(ctx, filter, _a2) @@ -108,36 +71,6 @@ func (_m *Storage) Find(ctx context.Context, filter *log.Filter, _a2 *options.Fi return r0, r1, r2 } -// Storage_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' -type Storage_Find_Call struct { - *mock.Call -} - -// Find is a helper method to define mock.On call -// - ctx context.Context -// - filter *log.Filter -// - _a2 *options.FindOptions -func (_e *Storage_Expecter) Find(ctx interface{}, filter interface{}, _a2 interface{}) *Storage_Find_Call { - return &Storage_Find_Call{Call: _e.mock.On("Find", ctx, filter, _a2)} -} - -func (_c *Storage_Find_Call) Run(run func(ctx context.Context, filter *log.Filter, _a2 *options.FindOptions)) *Storage_Find_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*log.Filter), args[2].(*options.FindOptions)) - }) - return _c -} - -func (_c *Storage_Find_Call) Return(_a0 []*log.Entry, _a1 int, _a2 error) *Storage_Find_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *Storage_Find_Call) RunAndReturn(run func(context.Context, *log.Filter, *options.FindOptions) ([]*log.Entry, int, error)) *Storage_Find_Call { - _c.Call.Return(run) - return _c -} - // Init provides a mock function with given fields: ctx func (_m *Storage) Init(ctx context.Context) error { ret := _m.Called(ctx) @@ -156,34 +89,6 @@ func (_m *Storage) Init(ctx context.Context) error { return r0 } -// Storage_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' -type Storage_Init_Call struct { - *mock.Call -} - -// Init is a helper method to define mock.On call -// - ctx context.Context -func (_e *Storage_Expecter) Init(ctx interface{}) *Storage_Init_Call { - return &Storage_Init_Call{Call: _e.mock.On("Init", ctx)} -} - -func (_c *Storage_Init_Call) Run(run func(ctx context.Context)) *Storage_Init_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Storage_Init_Call) Return(_a0 error) *Storage_Init_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Storage_Init_Call) RunAndReturn(run func(context.Context) error) *Storage_Init_Call { - _c.Call.Return(run) - return _c -} - // Log provides a mock function with given fields: ctx, entry func (_m *Storage) Log(ctx context.Context, entry []*log.Entry) error { ret := _m.Called(ctx, entry) @@ -202,35 +107,6 @@ func (_m *Storage) Log(ctx context.Context, entry []*log.Entry) error { return r0 } -// Storage_Log_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Log' -type Storage_Log_Call struct { - *mock.Call -} - -// Log is a helper method to define mock.On call -// - ctx context.Context -// - entry []*log.Entry -func (_e *Storage_Expecter) Log(ctx interface{}, entry interface{}) *Storage_Log_Call { - return &Storage_Log_Call{Call: _e.mock.On("Log", ctx, entry)} -} - -func (_c *Storage_Log_Call) Run(run func(ctx context.Context, entry []*log.Entry)) *Storage_Log_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]*log.Entry)) - }) - return _c -} - -func (_c *Storage_Log_Call) Return(_a0 error) *Storage_Log_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Storage_Log_Call) RunAndReturn(run func(context.Context, []*log.Entry) error) *Storage_Log_Call { - _c.Call.Return(run) - return _c -} - // Reset provides a mock function with given fields: ctx func (_m *Storage) Reset(ctx context.Context) error { ret := _m.Called(ctx) @@ -249,34 +125,6 @@ func (_m *Storage) Reset(ctx context.Context) error { return r0 } -// Storage_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset' -type Storage_Reset_Call struct { - *mock.Call -} - -// Reset is a helper method to define mock.On call -// - ctx context.Context -func (_e *Storage_Expecter) Reset(ctx interface{}) *Storage_Reset_Call { - return &Storage_Reset_Call{Call: _e.mock.On("Reset", ctx)} -} - -func (_c *Storage_Reset_Call) Run(run func(ctx context.Context)) *Storage_Reset_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Storage_Reset_Call) Return(_a0 error) *Storage_Reset_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Storage_Reset_Call) RunAndReturn(run func(context.Context) error) *Storage_Reset_Call { - _c.Call.Return(run) - return _c -} - // NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewStorage(t interface {