// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "github.com/bnema/dumber/internal/domain/entity" "github.com/bnema/dumber/internal/domain/repository" mock "github.com/stretchr/testify/mock" ) // NewMockHistoryRepository creates a new instance of MockHistoryRepository. 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 NewMockHistoryRepository(t interface { mock.TestingT Cleanup(func()) }) *MockHistoryRepository { mock := &MockHistoryRepository{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockHistoryRepository is an autogenerated mock type for the HistoryRepository type type MockHistoryRepository struct { mock.Mock } type MockHistoryRepository_Expecter struct { mock *mock.Mock } func (_m *MockHistoryRepository) EXPECT() *MockHistoryRepository_Expecter { return &MockHistoryRepository_Expecter{mock: &_m.Mock} } // Delete provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) Delete(ctx context.Context, id int64) error { ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, int64) error); ok { r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type MockHistoryRepository_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - id int64 func (_e *MockHistoryRepository_Expecter) Delete(ctx any, id any) *MockHistoryRepository_Delete_Call { return &MockHistoryRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} } func (_c *MockHistoryRepository_Delete_Call) Run(run func(ctx context.Context, id int64)) *MockHistoryRepository_Delete_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int64 if args[1] != nil { arg1 = args[1].(int64) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_Delete_Call) Return(err error) *MockHistoryRepository_Delete_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id int64) error) *MockHistoryRepository_Delete_Call { _c.Call.Return(run) return _c } // DeleteAll provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) DeleteAll(ctx context.Context) error { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for DeleteAll") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { r0 = returnFunc(ctx) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_DeleteAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAll' type MockHistoryRepository_DeleteAll_Call struct { *mock.Call } // DeleteAll is a helper method to define mock.On call // - ctx context.Context func (_e *MockHistoryRepository_Expecter) DeleteAll(ctx any) *MockHistoryRepository_DeleteAll_Call { return &MockHistoryRepository_DeleteAll_Call{Call: _e.mock.On("DeleteAll", ctx)} } func (_c *MockHistoryRepository_DeleteAll_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_DeleteAll_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockHistoryRepository_DeleteAll_Call) Return(err error) *MockHistoryRepository_DeleteAll_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_DeleteAll_Call) RunAndReturn(run func(ctx context.Context) error) *MockHistoryRepository_DeleteAll_Call { _c.Call.Return(run) return _c } // DeleteByDomain provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) DeleteByDomain(ctx context.Context, domain string) error { ret := _mock.Called(ctx, domain) if len(ret) == 0 { panic("no return value specified for DeleteByDomain") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(ctx, domain) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_DeleteByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByDomain' type MockHistoryRepository_DeleteByDomain_Call struct { *mock.Call } // DeleteByDomain is a helper method to define mock.On call // - ctx context.Context // - domain string func (_e *MockHistoryRepository_Expecter) DeleteByDomain(ctx any, domain any) *MockHistoryRepository_DeleteByDomain_Call { return &MockHistoryRepository_DeleteByDomain_Call{Call: _e.mock.On("DeleteByDomain", ctx, domain)} } func (_c *MockHistoryRepository_DeleteByDomain_Call) Run(run func(ctx context.Context, domain string)) *MockHistoryRepository_DeleteByDomain_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_DeleteByDomain_Call) Return(err error) *MockHistoryRepository_DeleteByDomain_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_DeleteByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockHistoryRepository_DeleteByDomain_Call { _c.Call.Return(run) return _c } // DeleteOlderThan provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) DeleteOlderThan(ctx context.Context, before time.Time) error { ret := _mock.Called(ctx, before) if len(ret) == 0 { panic("no return value specified for DeleteOlderThan") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok { r0 = returnFunc(ctx, before) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_DeleteOlderThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOlderThan' type MockHistoryRepository_DeleteOlderThan_Call struct { *mock.Call } // DeleteOlderThan is a helper method to define mock.On call // - ctx context.Context // - before time.Time func (_e *MockHistoryRepository_Expecter) DeleteOlderThan(ctx any, before any) *MockHistoryRepository_DeleteOlderThan_Call { return &MockHistoryRepository_DeleteOlderThan_Call{Call: _e.mock.On("DeleteOlderThan", ctx, before)} } func (_c *MockHistoryRepository_DeleteOlderThan_Call) Run(run func(ctx context.Context, before time.Time)) *MockHistoryRepository_DeleteOlderThan_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 time.Time if args[1] != nil { arg1 = args[1].(time.Time) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_DeleteOlderThan_Call) Return(err error) *MockHistoryRepository_DeleteOlderThan_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_DeleteOlderThan_Call) RunAndReturn(run func(ctx context.Context, before time.Time) error) *MockHistoryRepository_DeleteOlderThan_Call { _c.Call.Return(run) return _c } // DeleteSince provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) DeleteSince(ctx context.Context, since time.Time) error { ret := _mock.Called(ctx, since) if len(ret) == 0 { panic("no return value specified for DeleteSince") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok { r0 = returnFunc(ctx, since) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_DeleteSince_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSince' type MockHistoryRepository_DeleteSince_Call struct { *mock.Call } // DeleteSince is a helper method to define mock.On call // - ctx context.Context // - since time.Time func (_e *MockHistoryRepository_Expecter) DeleteSince(ctx any, since any) *MockHistoryRepository_DeleteSince_Call { return &MockHistoryRepository_DeleteSince_Call{Call: _e.mock.On("DeleteSince", ctx, since)} } func (_c *MockHistoryRepository_DeleteSince_Call) Run(run func(ctx context.Context, since time.Time)) *MockHistoryRepository_DeleteSince_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 time.Time if args[1] != nil { arg1 = args[1].(time.Time) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_DeleteSince_Call) Return(err error) *MockHistoryRepository_DeleteSince_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_DeleteSince_Call) RunAndReturn(run func(ctx context.Context, since time.Time) error) *MockHistoryRepository_DeleteSince_Call { _c.Call.Return(run) return _c } // FindByURL provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error) { ret := _mock.Called(ctx, url) if len(ret) == 0 { panic("no return value specified for FindByURL") } var r0 *entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.HistoryEntry, error)); ok { return returnFunc(ctx, url) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.HistoryEntry); ok { r0 = returnFunc(ctx, url) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, url) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL' type MockHistoryRepository_FindByURL_Call struct { *mock.Call } // FindByURL is a helper method to define mock.On call // - ctx context.Context // - url string func (_e *MockHistoryRepository_Expecter) FindByURL(ctx any, url any) *MockHistoryRepository_FindByURL_Call { return &MockHistoryRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)} } func (_c *MockHistoryRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_FindByURL_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_FindByURL_Call) Return(historyEntry *entity.HistoryEntry, err error) *MockHistoryRepository_FindByURL_Call { _c.Call.Return(historyEntry, err) return _c } func (_c *MockHistoryRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.HistoryEntry, error)) *MockHistoryRepository_FindByURL_Call { _c.Call.Return(run) return _c } // GetAllMostVisited provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetAllMostVisited(ctx context.Context) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetAllMostVisited") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetAllMostVisited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllMostVisited' type MockHistoryRepository_GetAllMostVisited_Call struct { *mock.Call } // GetAllMostVisited is a helper method to define mock.On call // - ctx context.Context func (_e *MockHistoryRepository_Expecter) GetAllMostVisited(ctx any) *MockHistoryRepository_GetAllMostVisited_Call { return &MockHistoryRepository_GetAllMostVisited_Call{Call: _e.mock.On("GetAllMostVisited", ctx)} } func (_c *MockHistoryRepository_GetAllMostVisited_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetAllMostVisited_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockHistoryRepository_GetAllMostVisited_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetAllMostVisited_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetAllMostVisited_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetAllMostVisited_Call { _c.Call.Return(run) return _c } // GetAllRecentHistory provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetAllRecentHistory(ctx context.Context) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetAllRecentHistory") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetAllRecentHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllRecentHistory' type MockHistoryRepository_GetAllRecentHistory_Call struct { *mock.Call } // GetAllRecentHistory is a helper method to define mock.On call // - ctx context.Context func (_e *MockHistoryRepository_Expecter) GetAllRecentHistory(ctx any) *MockHistoryRepository_GetAllRecentHistory_Call { return &MockHistoryRepository_GetAllRecentHistory_Call{Call: _e.mock.On("GetAllRecentHistory", ctx)} } func (_c *MockHistoryRepository_GetAllRecentHistory_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetAllRecentHistory_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockHistoryRepository_GetAllRecentHistory_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetAllRecentHistory_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetAllRecentHistory_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetAllRecentHistory_Call { _c.Call.Return(run) return _c } // GetDailyVisitCount provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetDailyVisitCount(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error) { ret := _mock.Called(ctx, daysAgo) if len(ret) == 0 { panic("no return value specified for GetDailyVisitCount") } var r0 []*entity.DailyVisitCount var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.DailyVisitCount, error)); ok { return returnFunc(ctx, daysAgo) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.DailyVisitCount); ok { r0 = returnFunc(ctx, daysAgo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.DailyVisitCount) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, daysAgo) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetDailyVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDailyVisitCount' type MockHistoryRepository_GetDailyVisitCount_Call struct { *mock.Call } // GetDailyVisitCount is a helper method to define mock.On call // - ctx context.Context // - daysAgo string func (_e *MockHistoryRepository_Expecter) GetDailyVisitCount(ctx any, daysAgo any) *MockHistoryRepository_GetDailyVisitCount_Call { return &MockHistoryRepository_GetDailyVisitCount_Call{Call: _e.mock.On("GetDailyVisitCount", ctx, daysAgo)} } func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Run(run func(ctx context.Context, daysAgo string)) *MockHistoryRepository_GetDailyVisitCount_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Return(dailyVisitCounts []*entity.DailyVisitCount, err error) *MockHistoryRepository_GetDailyVisitCount_Call { _c.Call.Return(dailyVisitCounts, err) return _c } func (_c *MockHistoryRepository_GetDailyVisitCount_Call) RunAndReturn(run func(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error)) *MockHistoryRepository_GetDailyVisitCount_Call { _c.Call.Return(run) return _c } // GetDomainStats provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error) { ret := _mock.Called(ctx, limit) if len(ret) == 0 { panic("no return value specified for GetDomainStats") } var r0 []*entity.DomainStat var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.DomainStat, error)); ok { return returnFunc(ctx, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.DomainStat); ok { r0 = returnFunc(ctx, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.DomainStat) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { r1 = returnFunc(ctx, limit) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetDomainStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDomainStats' type MockHistoryRepository_GetDomainStats_Call struct { *mock.Call } // GetDomainStats is a helper method to define mock.On call // - ctx context.Context // - limit int func (_e *MockHistoryRepository_Expecter) GetDomainStats(ctx any, limit any) *MockHistoryRepository_GetDomainStats_Call { return &MockHistoryRepository_GetDomainStats_Call{Call: _e.mock.On("GetDomainStats", ctx, limit)} } func (_c *MockHistoryRepository_GetDomainStats_Call) Run(run func(ctx context.Context, limit int)) *MockHistoryRepository_GetDomainStats_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_GetDomainStats_Call) Return(domainStats []*entity.DomainStat, err error) *MockHistoryRepository_GetDomainStats_Call { _c.Call.Return(domainStats, err) return _c } func (_c *MockHistoryRepository_GetDomainStats_Call) RunAndReturn(run func(ctx context.Context, limit int) ([]*entity.DomainStat, error)) *MockHistoryRepository_GetDomainStats_Call { _c.Call.Return(run) return _c } // GetHourlyDistribution provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetHourlyDistribution(ctx context.Context) ([]*entity.HourlyDistribution, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetHourlyDistribution") } var r0 []*entity.HourlyDistribution var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HourlyDistribution, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HourlyDistribution); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HourlyDistribution) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetHourlyDistribution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHourlyDistribution' type MockHistoryRepository_GetHourlyDistribution_Call struct { *mock.Call } // GetHourlyDistribution is a helper method to define mock.On call // - ctx context.Context func (_e *MockHistoryRepository_Expecter) GetHourlyDistribution(ctx any) *MockHistoryRepository_GetHourlyDistribution_Call { return &MockHistoryRepository_GetHourlyDistribution_Call{Call: _e.mock.On("GetHourlyDistribution", ctx)} } func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetHourlyDistribution_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Return(hourlyDistributions []*entity.HourlyDistribution, err error) *MockHistoryRepository_GetHourlyDistribution_Call { _c.Call.Return(hourlyDistributions, err) return _c } func (_c *MockHistoryRepository_GetHourlyDistribution_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HourlyDistribution, error)) *MockHistoryRepository_GetHourlyDistribution_Call { _c.Call.Return(run) return _c } // GetMostVisited provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetMostVisited(ctx context.Context, days int) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, days) if len(ret) == 0 { panic("no return value specified for GetMostVisited") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, days) } if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, days) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { r1 = returnFunc(ctx, days) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetMostVisited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMostVisited' type MockHistoryRepository_GetMostVisited_Call struct { *mock.Call } // GetMostVisited is a helper method to define mock.On call // - ctx context.Context // - days int func (_e *MockHistoryRepository_Expecter) GetMostVisited(ctx any, days any) *MockHistoryRepository_GetMostVisited_Call { return &MockHistoryRepository_GetMostVisited_Call{Call: _e.mock.On("GetMostVisited", ctx, days)} } func (_c *MockHistoryRepository_GetMostVisited_Call) Run(run func(ctx context.Context, days int)) *MockHistoryRepository_GetMostVisited_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_GetMostVisited_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetMostVisited_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetMostVisited_Call) RunAndReturn(run func(ctx context.Context, days int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetMostVisited_Call { _c.Call.Return(run) return _c } // GetMostVisitedWithin provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetMostVisitedWithin(ctx context.Context, limit int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, limit, scope) if len(ret) == 0 { panic("no return value specified for GetMostVisitedWithin") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int, repository.HistoryScope) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, limit, scope) } if returnFunc, ok := ret.Get(0).(func(context.Context, int, repository.HistoryScope) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, limit, scope) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int, repository.HistoryScope) error); ok { r1 = returnFunc(ctx, limit, scope) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetMostVisitedWithin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMostVisitedWithin' type MockHistoryRepository_GetMostVisitedWithin_Call struct { *mock.Call } // GetMostVisitedWithin is a helper method to define mock.On call // - ctx context.Context // - limit int // - scope repository.HistoryScope func (_e *MockHistoryRepository_Expecter) GetMostVisitedWithin(ctx any, limit any, scope any) *MockHistoryRepository_GetMostVisitedWithin_Call { return &MockHistoryRepository_GetMostVisitedWithin_Call{Call: _e.mock.On("GetMostVisitedWithin", ctx, limit, scope)} } func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) Run(run func(ctx context.Context, limit int, scope repository.HistoryScope)) *MockHistoryRepository_GetMostVisitedWithin_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } var arg2 repository.HistoryScope if args[2] != nil { arg2 = args[2].(repository.HistoryScope) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetMostVisitedWithin_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) RunAndReturn(run func(ctx context.Context, limit int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetMostVisitedWithin_Call { _c.Call.Return(run) return _c } // GetRecent provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetRecent(ctx context.Context, limit int, offset int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, limit, offset, scope) if len(ret) == 0 { panic("no return value specified for GetRecent") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int, int, repository.HistoryScope) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, limit, offset, scope) } if returnFunc, ok := ret.Get(0).(func(context.Context, int, int, repository.HistoryScope) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, limit, offset, scope) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int, int, repository.HistoryScope) error); ok { r1 = returnFunc(ctx, limit, offset, scope) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetRecent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecent' type MockHistoryRepository_GetRecent_Call struct { *mock.Call } // GetRecent is a helper method to define mock.On call // - ctx context.Context // - limit int // - offset int // - scope repository.HistoryScope func (_e *MockHistoryRepository_Expecter) GetRecent(ctx any, limit any, offset any, scope any) *MockHistoryRepository_GetRecent_Call { return &MockHistoryRepository_GetRecent_Call{Call: _e.mock.On("GetRecent", ctx, limit, offset, scope)} } func (_c *MockHistoryRepository_GetRecent_Call) Run(run func(ctx context.Context, limit int, offset int, scope repository.HistoryScope)) *MockHistoryRepository_GetRecent_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } var arg2 int if args[2] != nil { arg2 = args[2].(int) } var arg3 repository.HistoryScope if args[3] != nil { arg3 = args[3].(repository.HistoryScope) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockHistoryRepository_GetRecent_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecent_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetRecent_Call) RunAndReturn(run func(ctx context.Context, limit int, offset int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecent_Call { _c.Call.Return(run) return _c } // GetRecentByDomain provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetRecentByDomain(ctx context.Context, domain string, limit int, offset int) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, domain, limit, offset) if len(ret) == 0 { panic("no return value specified for GetRecentByDomain") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, int) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, domain, limit, offset) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, int) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, domain, limit, offset) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, int, int) error); ok { r1 = returnFunc(ctx, domain, limit, offset) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetRecentByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentByDomain' type MockHistoryRepository_GetRecentByDomain_Call struct { *mock.Call } // GetRecentByDomain is a helper method to define mock.On call // - ctx context.Context // - domain string // - limit int // - offset int func (_e *MockHistoryRepository_Expecter) GetRecentByDomain(ctx any, domain any, limit any, offset any) *MockHistoryRepository_GetRecentByDomain_Call { return &MockHistoryRepository_GetRecentByDomain_Call{Call: _e.mock.On("GetRecentByDomain", ctx, domain, limit, offset)} } func (_c *MockHistoryRepository_GetRecentByDomain_Call) Run(run func(ctx context.Context, domain string, limit int, offset int)) *MockHistoryRepository_GetRecentByDomain_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 int if args[2] != nil { arg2 = args[2].(int) } var arg3 int if args[3] != nil { arg3 = args[3].(int) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockHistoryRepository_GetRecentByDomain_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentByDomain_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetRecentByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string, limit int, offset int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentByDomain_Call { _c.Call.Return(run) return _c } // GetRecentSince provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetRecentSince(ctx context.Context, days int) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, days) if len(ret) == 0 { panic("no return value specified for GetRecentSince") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, days) } if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, days) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { r1 = returnFunc(ctx, days) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetRecentSince_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentSince' type MockHistoryRepository_GetRecentSince_Call struct { *mock.Call } // GetRecentSince is a helper method to define mock.On call // - ctx context.Context // - days int func (_e *MockHistoryRepository_Expecter) GetRecentSince(ctx any, days any) *MockHistoryRepository_GetRecentSince_Call { return &MockHistoryRepository_GetRecentSince_Call{Call: _e.mock.On("GetRecentSince", ctx, days)} } func (_c *MockHistoryRepository_GetRecentSince_Call) Run(run func(ctx context.Context, days int)) *MockHistoryRepository_GetRecentSince_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_GetRecentSince_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentSince_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetRecentSince_Call) RunAndReturn(run func(ctx context.Context, days int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentSince_Call { _c.Call.Return(run) return _c } // GetRecentWindow provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetRecentWindow(ctx context.Context, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, before, beforeID, limit) if len(ret) == 0 { panic("no return value specified for GetRecentWindow") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time, int64, int) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, before, beforeID, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time, int64, int) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, before, beforeID, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, time.Time, int64, int) error); ok { r1 = returnFunc(ctx, before, beforeID, limit) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetRecentWindow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentWindow' type MockHistoryRepository_GetRecentWindow_Call struct { *mock.Call } // GetRecentWindow is a helper method to define mock.On call // - ctx context.Context // - before time.Time // - beforeID int64 // - limit int func (_e *MockHistoryRepository_Expecter) GetRecentWindow(ctx any, before any, beforeID any, limit any) *MockHistoryRepository_GetRecentWindow_Call { return &MockHistoryRepository_GetRecentWindow_Call{Call: _e.mock.On("GetRecentWindow", ctx, before, beforeID, limit)} } func (_c *MockHistoryRepository_GetRecentWindow_Call) Run(run func(ctx context.Context, before time.Time, beforeID int64, limit int)) *MockHistoryRepository_GetRecentWindow_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 time.Time if args[1] != nil { arg1 = args[1].(time.Time) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } var arg3 int if args[3] != nil { arg3 = args[3].(int) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockHistoryRepository_GetRecentWindow_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentWindow_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetRecentWindow_Call) RunAndReturn(run func(ctx context.Context, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentWindow_Call { _c.Call.Return(run) return _c } // GetRecentWindowByDomain provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetRecentWindowByDomain(ctx context.Context, domain string, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error) { ret := _mock.Called(ctx, domain, before, beforeID, limit) if len(ret) == 0 { panic("no return value specified for GetRecentWindowByDomain") } var r0 []*entity.HistoryEntry var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time, int64, int) ([]*entity.HistoryEntry, error)); ok { return returnFunc(ctx, domain, before, beforeID, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time, int64, int) []*entity.HistoryEntry); ok { r0 = returnFunc(ctx, domain, before, beforeID, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.HistoryEntry) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, time.Time, int64, int) error); ok { r1 = returnFunc(ctx, domain, before, beforeID, limit) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetRecentWindowByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentWindowByDomain' type MockHistoryRepository_GetRecentWindowByDomain_Call struct { *mock.Call } // GetRecentWindowByDomain is a helper method to define mock.On call // - ctx context.Context // - domain string // - before time.Time // - beforeID int64 // - limit int func (_e *MockHistoryRepository_Expecter) GetRecentWindowByDomain(ctx any, domain any, before any, beforeID any, limit any) *MockHistoryRepository_GetRecentWindowByDomain_Call { return &MockHistoryRepository_GetRecentWindowByDomain_Call{Call: _e.mock.On("GetRecentWindowByDomain", ctx, domain, before, beforeID, limit)} } func (_c *MockHistoryRepository_GetRecentWindowByDomain_Call) Run(run func(ctx context.Context, domain string, before time.Time, beforeID int64, limit int)) *MockHistoryRepository_GetRecentWindowByDomain_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 time.Time if args[2] != nil { arg2 = args[2].(time.Time) } var arg3 int64 if args[3] != nil { arg3 = args[3].(int64) } var arg4 int if args[4] != nil { arg4 = args[4].(int) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *MockHistoryRepository_GetRecentWindowByDomain_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentWindowByDomain_Call { _c.Call.Return(historyEntrys, err) return _c } func (_c *MockHistoryRepository_GetRecentWindowByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentWindowByDomain_Call { _c.Call.Return(run) return _c } // GetStats provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) GetStats(ctx context.Context) (*entity.HistoryStats, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetStats") } var r0 *entity.HistoryStats var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (*entity.HistoryStats, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) *entity.HistoryStats); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.HistoryStats) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats' type MockHistoryRepository_GetStats_Call struct { *mock.Call } // GetStats is a helper method to define mock.On call // - ctx context.Context func (_e *MockHistoryRepository_Expecter) GetStats(ctx any) *MockHistoryRepository_GetStats_Call { return &MockHistoryRepository_GetStats_Call{Call: _e.mock.On("GetStats", ctx)} } func (_c *MockHistoryRepository_GetStats_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetStats_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockHistoryRepository_GetStats_Call) Return(historyStats *entity.HistoryStats, err error) *MockHistoryRepository_GetStats_Call { _c.Call.Return(historyStats, err) return _c } func (_c *MockHistoryRepository_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*entity.HistoryStats, error)) *MockHistoryRepository_GetStats_Call { _c.Call.Return(run) return _c } // IncrementVisitCount provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) IncrementVisitCount(ctx context.Context, url string) error { ret := _mock.Called(ctx, url) if len(ret) == 0 { panic("no return value specified for IncrementVisitCount") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(ctx, url) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_IncrementVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementVisitCount' type MockHistoryRepository_IncrementVisitCount_Call struct { *mock.Call } // IncrementVisitCount is a helper method to define mock.On call // - ctx context.Context // - url string func (_e *MockHistoryRepository_Expecter) IncrementVisitCount(ctx any, url any) *MockHistoryRepository_IncrementVisitCount_Call { return &MockHistoryRepository_IncrementVisitCount_Call{Call: _e.mock.On("IncrementVisitCount", ctx, url)} } func (_c *MockHistoryRepository_IncrementVisitCount_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_IncrementVisitCount_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_IncrementVisitCount_Call) Return(err error) *MockHistoryRepository_IncrementVisitCount_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_IncrementVisitCount_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockHistoryRepository_IncrementVisitCount_Call { _c.Call.Return(run) return _c } // Save provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) Save(ctx context.Context, entry *entity.HistoryEntry) error { ret := _mock.Called(ctx, entry) if len(ret) == 0 { panic("no return value specified for Save") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.HistoryEntry) error); ok { r0 = returnFunc(ctx, entry) } else { r0 = ret.Error(0) } return r0 } // MockHistoryRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' type MockHistoryRepository_Save_Call struct { *mock.Call } // Save is a helper method to define mock.On call // - ctx context.Context // - entry *entity.HistoryEntry func (_e *MockHistoryRepository_Expecter) Save(ctx any, entry any) *MockHistoryRepository_Save_Call { return &MockHistoryRepository_Save_Call{Call: _e.mock.On("Save", ctx, entry)} } func (_c *MockHistoryRepository_Save_Call) Run(run func(ctx context.Context, entry *entity.HistoryEntry)) *MockHistoryRepository_Save_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *entity.HistoryEntry if args[1] != nil { arg1 = args[1].(*entity.HistoryEntry) } run( arg0, arg1, ) }) return _c } func (_c *MockHistoryRepository_Save_Call) Return(err error) *MockHistoryRepository_Save_Call { _c.Call.Return(err) return _c } func (_c *MockHistoryRepository_Save_Call) RunAndReturn(run func(ctx context.Context, entry *entity.HistoryEntry) error) *MockHistoryRepository_Save_Call { _c.Call.Return(run) return _c } // Search provides a mock function for the type MockHistoryRepository func (_mock *MockHistoryRepository) Search(ctx context.Context, query string, limit int, scope repository.HistoryScope) ([]entity.HistoryMatch, error) { ret := _mock.Called(ctx, query, limit, scope) if len(ret) == 0 { panic("no return value specified for Search") } var r0 []entity.HistoryMatch var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, repository.HistoryScope) ([]entity.HistoryMatch, error)); ok { return returnFunc(ctx, query, limit, scope) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, repository.HistoryScope) []entity.HistoryMatch); ok { r0 = returnFunc(ctx, query, limit, scope) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]entity.HistoryMatch) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, int, repository.HistoryScope) error); ok { r1 = returnFunc(ctx, query, limit, scope) } else { r1 = ret.Error(1) } return r0, r1 } // MockHistoryRepository_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' type MockHistoryRepository_Search_Call struct { *mock.Call } // Search is a helper method to define mock.On call // - ctx context.Context // - query string // - limit int // - scope repository.HistoryScope func (_e *MockHistoryRepository_Expecter) Search(ctx any, query any, limit any, scope any) *MockHistoryRepository_Search_Call { return &MockHistoryRepository_Search_Call{Call: _e.mock.On("Search", ctx, query, limit, scope)} } func (_c *MockHistoryRepository_Search_Call) Run(run func(ctx context.Context, query string, limit int, scope repository.HistoryScope)) *MockHistoryRepository_Search_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 int if args[2] != nil { arg2 = args[2].(int) } var arg3 repository.HistoryScope if args[3] != nil { arg3 = args[3].(repository.HistoryScope) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockHistoryRepository_Search_Call) Return(historyMatchs []entity.HistoryMatch, err error) *MockHistoryRepository_Search_Call { _c.Call.Return(historyMatchs, err) return _c } func (_c *MockHistoryRepository_Search_Call) RunAndReturn(run func(ctx context.Context, query string, limit int, scope repository.HistoryScope) ([]entity.HistoryMatch, error)) *MockHistoryRepository_Search_Call { _c.Call.Return(run) return _c }