1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "time"
10
11 "github.com/bnema/dumber/internal/domain/entity"
12 "github.com/bnema/dumber/internal/domain/repository"
13 mock "github.com/stretchr/testify/mock"
14)
15
16// 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.
17// The first argument is typically a *testing.T value.
18func NewMockHistoryRepository(t interface {
19 mock.TestingT
20 Cleanup(func())
21}) *MockHistoryRepository {
22 mock := &MockHistoryRepository{}
23 mock.Mock.Test(t)
24
25 t.Cleanup(func() { mock.AssertExpectations(t) })
26
27 return mock
28}
29
30// MockHistoryRepository is an autogenerated mock type for the HistoryRepository type
31type MockHistoryRepository struct {
32 mock.Mock
33}
34
35type MockHistoryRepository_Expecter struct {
36 mock *mock.Mock
37}
38
39func (_m *MockHistoryRepository) EXPECT() *MockHistoryRepository_Expecter {
40 return &MockHistoryRepository_Expecter{mock: &_m.Mock}
41}
42
43// Delete provides a mock function for the type MockHistoryRepository
44func (_mock *MockHistoryRepository) Delete(ctx context.Context, id int64) error {
45 ret := _mock.Called(ctx, id)
46
47 if len(ret) == 0 {
48 panic("no return value specified for Delete")
49 }
50
51 var r0 error
52 if returnFunc, ok := ret.Get(0).(func(context.Context, int64) error); ok {
53 r0 = returnFunc(ctx, id)
54 } else {
55 r0 = ret.Error(0)
56 }
57 return r0
58}
59
60// MockHistoryRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
61type MockHistoryRepository_Delete_Call struct {
62 *mock.Call
63}
64
65// Delete is a helper method to define mock.On call
66// - ctx context.Context
67// - id int64
68func (_e *MockHistoryRepository_Expecter) Delete(ctx any, id any) *MockHistoryRepository_Delete_Call {
69 return &MockHistoryRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
70}
71
72func (_c *MockHistoryRepository_Delete_Call) Run(run func(ctx context.Context, id int64)) *MockHistoryRepository_Delete_Call {
73 _c.Call.Run(func(args mock.Arguments) {
74 var arg0 context.Context
75 if args[0] != nil {
76 arg0 = args[0].(context.Context)
77 }
78 var arg1 int64
79 if args[1] != nil {
80 arg1 = args[1].(int64)
81 }
82 run(
83 arg0,
84 arg1,
85 )
86 })
87 return _c
88}
89
90func (_c *MockHistoryRepository_Delete_Call) Return(err error) *MockHistoryRepository_Delete_Call {
91 _c.Call.Return(err)
92 return _c
93}
94
95func (_c *MockHistoryRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id int64) error) *MockHistoryRepository_Delete_Call {
96 _c.Call.Return(run)
97 return _c
98}
99
100// DeleteAll provides a mock function for the type MockHistoryRepository
101func (_mock *MockHistoryRepository) DeleteAll(ctx context.Context) error {
102 ret := _mock.Called(ctx)
103
104 if len(ret) == 0 {
105 panic("no return value specified for DeleteAll")
106 }
107
108 var r0 error
109 if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
110 r0 = returnFunc(ctx)
111 } else {
112 r0 = ret.Error(0)
113 }
114 return r0
115}
116
117// MockHistoryRepository_DeleteAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAll'
118type MockHistoryRepository_DeleteAll_Call struct {
119 *mock.Call
120}
121
122// DeleteAll is a helper method to define mock.On call
123// - ctx context.Context
124func (_e *MockHistoryRepository_Expecter) DeleteAll(ctx any) *MockHistoryRepository_DeleteAll_Call {
125 return &MockHistoryRepository_DeleteAll_Call{Call: _e.mock.On("DeleteAll", ctx)}
126}
127
128func (_c *MockHistoryRepository_DeleteAll_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_DeleteAll_Call {
129 _c.Call.Run(func(args mock.Arguments) {
130 var arg0 context.Context
131 if args[0] != nil {
132 arg0 = args[0].(context.Context)
133 }
134 run(
135 arg0,
136 )
137 })
138 return _c
139}
140
141func (_c *MockHistoryRepository_DeleteAll_Call) Return(err error) *MockHistoryRepository_DeleteAll_Call {
142 _c.Call.Return(err)
143 return _c
144}
145
146func (_c *MockHistoryRepository_DeleteAll_Call) RunAndReturn(run func(ctx context.Context) error) *MockHistoryRepository_DeleteAll_Call {
147 _c.Call.Return(run)
148 return _c
149}
150
151// DeleteByDomain provides a mock function for the type MockHistoryRepository
152func (_mock *MockHistoryRepository) DeleteByDomain(ctx context.Context, domain string) error {
153 ret := _mock.Called(ctx, domain)
154
155 if len(ret) == 0 {
156 panic("no return value specified for DeleteByDomain")
157 }
158
159 var r0 error
160 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
161 r0 = returnFunc(ctx, domain)
162 } else {
163 r0 = ret.Error(0)
164 }
165 return r0
166}
167
168// MockHistoryRepository_DeleteByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByDomain'
169type MockHistoryRepository_DeleteByDomain_Call struct {
170 *mock.Call
171}
172
173// DeleteByDomain is a helper method to define mock.On call
174// - ctx context.Context
175// - domain string
176func (_e *MockHistoryRepository_Expecter) DeleteByDomain(ctx any, domain any) *MockHistoryRepository_DeleteByDomain_Call {
177 return &MockHistoryRepository_DeleteByDomain_Call{Call: _e.mock.On("DeleteByDomain", ctx, domain)}
178}
179
180func (_c *MockHistoryRepository_DeleteByDomain_Call) Run(run func(ctx context.Context, domain string)) *MockHistoryRepository_DeleteByDomain_Call {
181 _c.Call.Run(func(args mock.Arguments) {
182 var arg0 context.Context
183 if args[0] != nil {
184 arg0 = args[0].(context.Context)
185 }
186 var arg1 string
187 if args[1] != nil {
188 arg1 = args[1].(string)
189 }
190 run(
191 arg0,
192 arg1,
193 )
194 })
195 return _c
196}
197
198func (_c *MockHistoryRepository_DeleteByDomain_Call) Return(err error) *MockHistoryRepository_DeleteByDomain_Call {
199 _c.Call.Return(err)
200 return _c
201}
202
203func (_c *MockHistoryRepository_DeleteByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockHistoryRepository_DeleteByDomain_Call {
204 _c.Call.Return(run)
205 return _c
206}
207
208// DeleteOlderThan provides a mock function for the type MockHistoryRepository
209func (_mock *MockHistoryRepository) DeleteOlderThan(ctx context.Context, before time.Time) error {
210 ret := _mock.Called(ctx, before)
211
212 if len(ret) == 0 {
213 panic("no return value specified for DeleteOlderThan")
214 }
215
216 var r0 error
217 if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok {
218 r0 = returnFunc(ctx, before)
219 } else {
220 r0 = ret.Error(0)
221 }
222 return r0
223}
224
225// MockHistoryRepository_DeleteOlderThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOlderThan'
226type MockHistoryRepository_DeleteOlderThan_Call struct {
227 *mock.Call
228}
229
230// DeleteOlderThan is a helper method to define mock.On call
231// - ctx context.Context
232// - before time.Time
233func (_e *MockHistoryRepository_Expecter) DeleteOlderThan(ctx any, before any) *MockHistoryRepository_DeleteOlderThan_Call {
234 return &MockHistoryRepository_DeleteOlderThan_Call{Call: _e.mock.On("DeleteOlderThan", ctx, before)}
235}
236
237func (_c *MockHistoryRepository_DeleteOlderThan_Call) Run(run func(ctx context.Context, before time.Time)) *MockHistoryRepository_DeleteOlderThan_Call {
238 _c.Call.Run(func(args mock.Arguments) {
239 var arg0 context.Context
240 if args[0] != nil {
241 arg0 = args[0].(context.Context)
242 }
243 var arg1 time.Time
244 if args[1] != nil {
245 arg1 = args[1].(time.Time)
246 }
247 run(
248 arg0,
249 arg1,
250 )
251 })
252 return _c
253}
254
255func (_c *MockHistoryRepository_DeleteOlderThan_Call) Return(err error) *MockHistoryRepository_DeleteOlderThan_Call {
256 _c.Call.Return(err)
257 return _c
258}
259
260func (_c *MockHistoryRepository_DeleteOlderThan_Call) RunAndReturn(run func(ctx context.Context, before time.Time) error) *MockHistoryRepository_DeleteOlderThan_Call {
261 _c.Call.Return(run)
262 return _c
263}
264
265// DeleteSince provides a mock function for the type MockHistoryRepository
266func (_mock *MockHistoryRepository) DeleteSince(ctx context.Context, since time.Time) error {
267 ret := _mock.Called(ctx, since)
268
269 if len(ret) == 0 {
270 panic("no return value specified for DeleteSince")
271 }
272
273 var r0 error
274 if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok {
275 r0 = returnFunc(ctx, since)
276 } else {
277 r0 = ret.Error(0)
278 }
279 return r0
280}
281
282// MockHistoryRepository_DeleteSince_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSince'
283type MockHistoryRepository_DeleteSince_Call struct {
284 *mock.Call
285}
286
287// DeleteSince is a helper method to define mock.On call
288// - ctx context.Context
289// - since time.Time
290func (_e *MockHistoryRepository_Expecter) DeleteSince(ctx any, since any) *MockHistoryRepository_DeleteSince_Call {
291 return &MockHistoryRepository_DeleteSince_Call{Call: _e.mock.On("DeleteSince", ctx, since)}
292}
293
294func (_c *MockHistoryRepository_DeleteSince_Call) Run(run func(ctx context.Context, since time.Time)) *MockHistoryRepository_DeleteSince_Call {
295 _c.Call.Run(func(args mock.Arguments) {
296 var arg0 context.Context
297 if args[0] != nil {
298 arg0 = args[0].(context.Context)
299 }
300 var arg1 time.Time
301 if args[1] != nil {
302 arg1 = args[1].(time.Time)
303 }
304 run(
305 arg0,
306 arg1,
307 )
308 })
309 return _c
310}
311
312func (_c *MockHistoryRepository_DeleteSince_Call) Return(err error) *MockHistoryRepository_DeleteSince_Call {
313 _c.Call.Return(err)
314 return _c
315}
316
317func (_c *MockHistoryRepository_DeleteSince_Call) RunAndReturn(run func(ctx context.Context, since time.Time) error) *MockHistoryRepository_DeleteSince_Call {
318 _c.Call.Return(run)
319 return _c
320}
321
322// FindByURL provides a mock function for the type MockHistoryRepository
323func (_mock *MockHistoryRepository) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error) {
324 ret := _mock.Called(ctx, url)
325
326 if len(ret) == 0 {
327 panic("no return value specified for FindByURL")
328 }
329
330 var r0 *entity.HistoryEntry
331 var r1 error
332 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.HistoryEntry, error)); ok {
333 return returnFunc(ctx, url)
334 }
335 if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.HistoryEntry); ok {
336 r0 = returnFunc(ctx, url)
337 } else {
338 if ret.Get(0) != nil {
339 r0 = ret.Get(0).(*entity.HistoryEntry)
340 }
341 }
342 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
343 r1 = returnFunc(ctx, url)
344 } else {
345 r1 = ret.Error(1)
346 }
347 return r0, r1
348}
349
350// MockHistoryRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL'
351type MockHistoryRepository_FindByURL_Call struct {
352 *mock.Call
353}
354
355// FindByURL is a helper method to define mock.On call
356// - ctx context.Context
357// - url string
358func (_e *MockHistoryRepository_Expecter) FindByURL(ctx any, url any) *MockHistoryRepository_FindByURL_Call {
359 return &MockHistoryRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)}
360}
361
362func (_c *MockHistoryRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_FindByURL_Call {
363 _c.Call.Run(func(args mock.Arguments) {
364 var arg0 context.Context
365 if args[0] != nil {
366 arg0 = args[0].(context.Context)
367 }
368 var arg1 string
369 if args[1] != nil {
370 arg1 = args[1].(string)
371 }
372 run(
373 arg0,
374 arg1,
375 )
376 })
377 return _c
378}
379
380func (_c *MockHistoryRepository_FindByURL_Call) Return(historyEntry *entity.HistoryEntry, err error) *MockHistoryRepository_FindByURL_Call {
381 _c.Call.Return(historyEntry, err)
382 return _c
383}
384
385func (_c *MockHistoryRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.HistoryEntry, error)) *MockHistoryRepository_FindByURL_Call {
386 _c.Call.Return(run)
387 return _c
388}
389
390// GetAllMostVisited provides a mock function for the type MockHistoryRepository
391func (_mock *MockHistoryRepository) GetAllMostVisited(ctx context.Context) ([]*entity.HistoryEntry, error) {
392 ret := _mock.Called(ctx)
393
394 if len(ret) == 0 {
395 panic("no return value specified for GetAllMostVisited")
396 }
397
398 var r0 []*entity.HistoryEntry
399 var r1 error
400 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HistoryEntry, error)); ok {
401 return returnFunc(ctx)
402 }
403 if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HistoryEntry); ok {
404 r0 = returnFunc(ctx)
405 } else {
406 if ret.Get(0) != nil {
407 r0 = ret.Get(0).([]*entity.HistoryEntry)
408 }
409 }
410 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
411 r1 = returnFunc(ctx)
412 } else {
413 r1 = ret.Error(1)
414 }
415 return r0, r1
416}
417
418// MockHistoryRepository_GetAllMostVisited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllMostVisited'
419type MockHistoryRepository_GetAllMostVisited_Call struct {
420 *mock.Call
421}
422
423// GetAllMostVisited is a helper method to define mock.On call
424// - ctx context.Context
425func (_e *MockHistoryRepository_Expecter) GetAllMostVisited(ctx any) *MockHistoryRepository_GetAllMostVisited_Call {
426 return &MockHistoryRepository_GetAllMostVisited_Call{Call: _e.mock.On("GetAllMostVisited", ctx)}
427}
428
429func (_c *MockHistoryRepository_GetAllMostVisited_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetAllMostVisited_Call {
430 _c.Call.Run(func(args mock.Arguments) {
431 var arg0 context.Context
432 if args[0] != nil {
433 arg0 = args[0].(context.Context)
434 }
435 run(
436 arg0,
437 )
438 })
439 return _c
440}
441
442func (_c *MockHistoryRepository_GetAllMostVisited_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetAllMostVisited_Call {
443 _c.Call.Return(historyEntrys, err)
444 return _c
445}
446
447func (_c *MockHistoryRepository_GetAllMostVisited_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetAllMostVisited_Call {
448 _c.Call.Return(run)
449 return _c
450}
451
452// GetAllRecentHistory provides a mock function for the type MockHistoryRepository
453func (_mock *MockHistoryRepository) GetAllRecentHistory(ctx context.Context) ([]*entity.HistoryEntry, error) {
454 ret := _mock.Called(ctx)
455
456 if len(ret) == 0 {
457 panic("no return value specified for GetAllRecentHistory")
458 }
459
460 var r0 []*entity.HistoryEntry
461 var r1 error
462 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HistoryEntry, error)); ok {
463 return returnFunc(ctx)
464 }
465 if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HistoryEntry); ok {
466 r0 = returnFunc(ctx)
467 } else {
468 if ret.Get(0) != nil {
469 r0 = ret.Get(0).([]*entity.HistoryEntry)
470 }
471 }
472 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
473 r1 = returnFunc(ctx)
474 } else {
475 r1 = ret.Error(1)
476 }
477 return r0, r1
478}
479
480// MockHistoryRepository_GetAllRecentHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllRecentHistory'
481type MockHistoryRepository_GetAllRecentHistory_Call struct {
482 *mock.Call
483}
484
485// GetAllRecentHistory is a helper method to define mock.On call
486// - ctx context.Context
487func (_e *MockHistoryRepository_Expecter) GetAllRecentHistory(ctx any) *MockHistoryRepository_GetAllRecentHistory_Call {
488 return &MockHistoryRepository_GetAllRecentHistory_Call{Call: _e.mock.On("GetAllRecentHistory", ctx)}
489}
490
491func (_c *MockHistoryRepository_GetAllRecentHistory_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetAllRecentHistory_Call {
492 _c.Call.Run(func(args mock.Arguments) {
493 var arg0 context.Context
494 if args[0] != nil {
495 arg0 = args[0].(context.Context)
496 }
497 run(
498 arg0,
499 )
500 })
501 return _c
502}
503
504func (_c *MockHistoryRepository_GetAllRecentHistory_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetAllRecentHistory_Call {
505 _c.Call.Return(historyEntrys, err)
506 return _c
507}
508
509func (_c *MockHistoryRepository_GetAllRecentHistory_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetAllRecentHistory_Call {
510 _c.Call.Return(run)
511 return _c
512}
513
514// GetDailyVisitCount provides a mock function for the type MockHistoryRepository
515func (_mock *MockHistoryRepository) GetDailyVisitCount(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error) {
516 ret := _mock.Called(ctx, daysAgo)
517
518 if len(ret) == 0 {
519 panic("no return value specified for GetDailyVisitCount")
520 }
521
522 var r0 []*entity.DailyVisitCount
523 var r1 error
524 if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.DailyVisitCount, error)); ok {
525 return returnFunc(ctx, daysAgo)
526 }
527 if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.DailyVisitCount); ok {
528 r0 = returnFunc(ctx, daysAgo)
529 } else {
530 if ret.Get(0) != nil {
531 r0 = ret.Get(0).([]*entity.DailyVisitCount)
532 }
533 }
534 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
535 r1 = returnFunc(ctx, daysAgo)
536 } else {
537 r1 = ret.Error(1)
538 }
539 return r0, r1
540}
541
542// MockHistoryRepository_GetDailyVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDailyVisitCount'
543type MockHistoryRepository_GetDailyVisitCount_Call struct {
544 *mock.Call
545}
546
547// GetDailyVisitCount is a helper method to define mock.On call
548// - ctx context.Context
549// - daysAgo string
550func (_e *MockHistoryRepository_Expecter) GetDailyVisitCount(ctx any, daysAgo any) *MockHistoryRepository_GetDailyVisitCount_Call {
551 return &MockHistoryRepository_GetDailyVisitCount_Call{Call: _e.mock.On("GetDailyVisitCount", ctx, daysAgo)}
552}
553
554func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Run(run func(ctx context.Context, daysAgo string)) *MockHistoryRepository_GetDailyVisitCount_Call {
555 _c.Call.Run(func(args mock.Arguments) {
556 var arg0 context.Context
557 if args[0] != nil {
558 arg0 = args[0].(context.Context)
559 }
560 var arg1 string
561 if args[1] != nil {
562 arg1 = args[1].(string)
563 }
564 run(
565 arg0,
566 arg1,
567 )
568 })
569 return _c
570}
571
572func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Return(dailyVisitCounts []*entity.DailyVisitCount, err error) *MockHistoryRepository_GetDailyVisitCount_Call {
573 _c.Call.Return(dailyVisitCounts, err)
574 return _c
575}
576
577func (_c *MockHistoryRepository_GetDailyVisitCount_Call) RunAndReturn(run func(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error)) *MockHistoryRepository_GetDailyVisitCount_Call {
578 _c.Call.Return(run)
579 return _c
580}
581
582// GetDomainStats provides a mock function for the type MockHistoryRepository
583func (_mock *MockHistoryRepository) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error) {
584 ret := _mock.Called(ctx, limit)
585
586 if len(ret) == 0 {
587 panic("no return value specified for GetDomainStats")
588 }
589
590 var r0 []*entity.DomainStat
591 var r1 error
592 if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.DomainStat, error)); ok {
593 return returnFunc(ctx, limit)
594 }
595 if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.DomainStat); ok {
596 r0 = returnFunc(ctx, limit)
597 } else {
598 if ret.Get(0) != nil {
599 r0 = ret.Get(0).([]*entity.DomainStat)
600 }
601 }
602 if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok {
603 r1 = returnFunc(ctx, limit)
604 } else {
605 r1 = ret.Error(1)
606 }
607 return r0, r1
608}
609
610// MockHistoryRepository_GetDomainStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDomainStats'
611type MockHistoryRepository_GetDomainStats_Call struct {
612 *mock.Call
613}
614
615// GetDomainStats is a helper method to define mock.On call
616// - ctx context.Context
617// - limit int
618func (_e *MockHistoryRepository_Expecter) GetDomainStats(ctx any, limit any) *MockHistoryRepository_GetDomainStats_Call {
619 return &MockHistoryRepository_GetDomainStats_Call{Call: _e.mock.On("GetDomainStats", ctx, limit)}
620}
621
622func (_c *MockHistoryRepository_GetDomainStats_Call) Run(run func(ctx context.Context, limit int)) *MockHistoryRepository_GetDomainStats_Call {
623 _c.Call.Run(func(args mock.Arguments) {
624 var arg0 context.Context
625 if args[0] != nil {
626 arg0 = args[0].(context.Context)
627 }
628 var arg1 int
629 if args[1] != nil {
630 arg1 = args[1].(int)
631 }
632 run(
633 arg0,
634 arg1,
635 )
636 })
637 return _c
638}
639
640func (_c *MockHistoryRepository_GetDomainStats_Call) Return(domainStats []*entity.DomainStat, err error) *MockHistoryRepository_GetDomainStats_Call {
641 _c.Call.Return(domainStats, err)
642 return _c
643}
644
645func (_c *MockHistoryRepository_GetDomainStats_Call) RunAndReturn(run func(ctx context.Context, limit int) ([]*entity.DomainStat, error)) *MockHistoryRepository_GetDomainStats_Call {
646 _c.Call.Return(run)
647 return _c
648}
649
650// GetHourlyDistribution provides a mock function for the type MockHistoryRepository
651func (_mock *MockHistoryRepository) GetHourlyDistribution(ctx context.Context) ([]*entity.HourlyDistribution, error) {
652 ret := _mock.Called(ctx)
653
654 if len(ret) == 0 {
655 panic("no return value specified for GetHourlyDistribution")
656 }
657
658 var r0 []*entity.HourlyDistribution
659 var r1 error
660 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HourlyDistribution, error)); ok {
661 return returnFunc(ctx)
662 }
663 if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HourlyDistribution); ok {
664 r0 = returnFunc(ctx)
665 } else {
666 if ret.Get(0) != nil {
667 r0 = ret.Get(0).([]*entity.HourlyDistribution)
668 }
669 }
670 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
671 r1 = returnFunc(ctx)
672 } else {
673 r1 = ret.Error(1)
674 }
675 return r0, r1
676}
677
678// MockHistoryRepository_GetHourlyDistribution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHourlyDistribution'
679type MockHistoryRepository_GetHourlyDistribution_Call struct {
680 *mock.Call
681}
682
683// GetHourlyDistribution is a helper method to define mock.On call
684// - ctx context.Context
685func (_e *MockHistoryRepository_Expecter) GetHourlyDistribution(ctx any) *MockHistoryRepository_GetHourlyDistribution_Call {
686 return &MockHistoryRepository_GetHourlyDistribution_Call{Call: _e.mock.On("GetHourlyDistribution", ctx)}
687}
688
689func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetHourlyDistribution_Call {
690 _c.Call.Run(func(args mock.Arguments) {
691 var arg0 context.Context
692 if args[0] != nil {
693 arg0 = args[0].(context.Context)
694 }
695 run(
696 arg0,
697 )
698 })
699 return _c
700}
701
702func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Return(hourlyDistributions []*entity.HourlyDistribution, err error) *MockHistoryRepository_GetHourlyDistribution_Call {
703 _c.Call.Return(hourlyDistributions, err)
704 return _c
705}
706
707func (_c *MockHistoryRepository_GetHourlyDistribution_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HourlyDistribution, error)) *MockHistoryRepository_GetHourlyDistribution_Call {
708 _c.Call.Return(run)
709 return _c
710}
711
712// GetMostVisited provides a mock function for the type MockHistoryRepository
713func (_mock *MockHistoryRepository) GetMostVisited(ctx context.Context, days int) ([]*entity.HistoryEntry, error) {
714 ret := _mock.Called(ctx, days)
715
716 if len(ret) == 0 {
717 panic("no return value specified for GetMostVisited")
718 }
719
720 var r0 []*entity.HistoryEntry
721 var r1 error
722 if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.HistoryEntry, error)); ok {
723 return returnFunc(ctx, days)
724 }
725 if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.HistoryEntry); ok {
726 r0 = returnFunc(ctx, days)
727 } else {
728 if ret.Get(0) != nil {
729 r0 = ret.Get(0).([]*entity.HistoryEntry)
730 }
731 }
732 if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok {
733 r1 = returnFunc(ctx, days)
734 } else {
735 r1 = ret.Error(1)
736 }
737 return r0, r1
738}
739
740// MockHistoryRepository_GetMostVisited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMostVisited'
741type MockHistoryRepository_GetMostVisited_Call struct {
742 *mock.Call
743}
744
745// GetMostVisited is a helper method to define mock.On call
746// - ctx context.Context
747// - days int
748func (_e *MockHistoryRepository_Expecter) GetMostVisited(ctx any, days any) *MockHistoryRepository_GetMostVisited_Call {
749 return &MockHistoryRepository_GetMostVisited_Call{Call: _e.mock.On("GetMostVisited", ctx, days)}
750}
751
752func (_c *MockHistoryRepository_GetMostVisited_Call) Run(run func(ctx context.Context, days int)) *MockHistoryRepository_GetMostVisited_Call {
753 _c.Call.Run(func(args mock.Arguments) {
754 var arg0 context.Context
755 if args[0] != nil {
756 arg0 = args[0].(context.Context)
757 }
758 var arg1 int
759 if args[1] != nil {
760 arg1 = args[1].(int)
761 }
762 run(
763 arg0,
764 arg1,
765 )
766 })
767 return _c
768}
769
770func (_c *MockHistoryRepository_GetMostVisited_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetMostVisited_Call {
771 _c.Call.Return(historyEntrys, err)
772 return _c
773}
774
775func (_c *MockHistoryRepository_GetMostVisited_Call) RunAndReturn(run func(ctx context.Context, days int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetMostVisited_Call {
776 _c.Call.Return(run)
777 return _c
778}
779
780// GetMostVisitedWithin provides a mock function for the type MockHistoryRepository
781func (_mock *MockHistoryRepository) GetMostVisitedWithin(ctx context.Context, limit int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error) {
782 ret := _mock.Called(ctx, limit, scope)
783
784 if len(ret) == 0 {
785 panic("no return value specified for GetMostVisitedWithin")
786 }
787
788 var r0 []*entity.HistoryEntry
789 var r1 error
790 if returnFunc, ok := ret.Get(0).(func(context.Context, int, repository.HistoryScope) ([]*entity.HistoryEntry, error)); ok {
791 return returnFunc(ctx, limit, scope)
792 }
793 if returnFunc, ok := ret.Get(0).(func(context.Context, int, repository.HistoryScope) []*entity.HistoryEntry); ok {
794 r0 = returnFunc(ctx, limit, scope)
795 } else {
796 if ret.Get(0) != nil {
797 r0 = ret.Get(0).([]*entity.HistoryEntry)
798 }
799 }
800 if returnFunc, ok := ret.Get(1).(func(context.Context, int, repository.HistoryScope) error); ok {
801 r1 = returnFunc(ctx, limit, scope)
802 } else {
803 r1 = ret.Error(1)
804 }
805 return r0, r1
806}
807
808// MockHistoryRepository_GetMostVisitedWithin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMostVisitedWithin'
809type MockHistoryRepository_GetMostVisitedWithin_Call struct {
810 *mock.Call
811}
812
813// GetMostVisitedWithin is a helper method to define mock.On call
814// - ctx context.Context
815// - limit int
816// - scope repository.HistoryScope
817func (_e *MockHistoryRepository_Expecter) GetMostVisitedWithin(ctx any, limit any, scope any) *MockHistoryRepository_GetMostVisitedWithin_Call {
818 return &MockHistoryRepository_GetMostVisitedWithin_Call{Call: _e.mock.On("GetMostVisitedWithin", ctx, limit, scope)}
819}
820
821func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) Run(run func(ctx context.Context, limit int, scope repository.HistoryScope)) *MockHistoryRepository_GetMostVisitedWithin_Call {
822 _c.Call.Run(func(args mock.Arguments) {
823 var arg0 context.Context
824 if args[0] != nil {
825 arg0 = args[0].(context.Context)
826 }
827 var arg1 int
828 if args[1] != nil {
829 arg1 = args[1].(int)
830 }
831 var arg2 repository.HistoryScope
832 if args[2] != nil {
833 arg2 = args[2].(repository.HistoryScope)
834 }
835 run(
836 arg0,
837 arg1,
838 arg2,
839 )
840 })
841 return _c
842}
843
844func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetMostVisitedWithin_Call {
845 _c.Call.Return(historyEntrys, err)
846 return _c
847}
848
849func (_c *MockHistoryRepository_GetMostVisitedWithin_Call) RunAndReturn(run func(ctx context.Context, limit int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetMostVisitedWithin_Call {
850 _c.Call.Return(run)
851 return _c
852}
853
854// GetRecent provides a mock function for the type MockHistoryRepository
855func (_mock *MockHistoryRepository) GetRecent(ctx context.Context, limit int, offset int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error) {
856 ret := _mock.Called(ctx, limit, offset, scope)
857
858 if len(ret) == 0 {
859 panic("no return value specified for GetRecent")
860 }
861
862 var r0 []*entity.HistoryEntry
863 var r1 error
864 if returnFunc, ok := ret.Get(0).(func(context.Context, int, int, repository.HistoryScope) ([]*entity.HistoryEntry, error)); ok {
865 return returnFunc(ctx, limit, offset, scope)
866 }
867 if returnFunc, ok := ret.Get(0).(func(context.Context, int, int, repository.HistoryScope) []*entity.HistoryEntry); ok {
868 r0 = returnFunc(ctx, limit, offset, scope)
869 } else {
870 if ret.Get(0) != nil {
871 r0 = ret.Get(0).([]*entity.HistoryEntry)
872 }
873 }
874 if returnFunc, ok := ret.Get(1).(func(context.Context, int, int, repository.HistoryScope) error); ok {
875 r1 = returnFunc(ctx, limit, offset, scope)
876 } else {
877 r1 = ret.Error(1)
878 }
879 return r0, r1
880}
881
882// MockHistoryRepository_GetRecent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecent'
883type MockHistoryRepository_GetRecent_Call struct {
884 *mock.Call
885}
886
887// GetRecent is a helper method to define mock.On call
888// - ctx context.Context
889// - limit int
890// - offset int
891// - scope repository.HistoryScope
892func (_e *MockHistoryRepository_Expecter) GetRecent(ctx any, limit any, offset any, scope any) *MockHistoryRepository_GetRecent_Call {
893 return &MockHistoryRepository_GetRecent_Call{Call: _e.mock.On("GetRecent", ctx, limit, offset, scope)}
894}
895
896func (_c *MockHistoryRepository_GetRecent_Call) Run(run func(ctx context.Context, limit int, offset int, scope repository.HistoryScope)) *MockHistoryRepository_GetRecent_Call {
897 _c.Call.Run(func(args mock.Arguments) {
898 var arg0 context.Context
899 if args[0] != nil {
900 arg0 = args[0].(context.Context)
901 }
902 var arg1 int
903 if args[1] != nil {
904 arg1 = args[1].(int)
905 }
906 var arg2 int
907 if args[2] != nil {
908 arg2 = args[2].(int)
909 }
910 var arg3 repository.HistoryScope
911 if args[3] != nil {
912 arg3 = args[3].(repository.HistoryScope)
913 }
914 run(
915 arg0,
916 arg1,
917 arg2,
918 arg3,
919 )
920 })
921 return _c
922}
923
924func (_c *MockHistoryRepository_GetRecent_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecent_Call {
925 _c.Call.Return(historyEntrys, err)
926 return _c
927}
928
929func (_c *MockHistoryRepository_GetRecent_Call) RunAndReturn(run func(ctx context.Context, limit int, offset int, scope repository.HistoryScope) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecent_Call {
930 _c.Call.Return(run)
931 return _c
932}
933
934// GetRecentByDomain provides a mock function for the type MockHistoryRepository
935func (_mock *MockHistoryRepository) GetRecentByDomain(ctx context.Context, domain string, limit int, offset int) ([]*entity.HistoryEntry, error) {
936 ret := _mock.Called(ctx, domain, limit, offset)
937
938 if len(ret) == 0 {
939 panic("no return value specified for GetRecentByDomain")
940 }
941
942 var r0 []*entity.HistoryEntry
943 var r1 error
944 if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, int) ([]*entity.HistoryEntry, error)); ok {
945 return returnFunc(ctx, domain, limit, offset)
946 }
947 if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, int) []*entity.HistoryEntry); ok {
948 r0 = returnFunc(ctx, domain, limit, offset)
949 } else {
950 if ret.Get(0) != nil {
951 r0 = ret.Get(0).([]*entity.HistoryEntry)
952 }
953 }
954 if returnFunc, ok := ret.Get(1).(func(context.Context, string, int, int) error); ok {
955 r1 = returnFunc(ctx, domain, limit, offset)
956 } else {
957 r1 = ret.Error(1)
958 }
959 return r0, r1
960}
961
962// MockHistoryRepository_GetRecentByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentByDomain'
963type MockHistoryRepository_GetRecentByDomain_Call struct {
964 *mock.Call
965}
966
967// GetRecentByDomain is a helper method to define mock.On call
968// - ctx context.Context
969// - domain string
970// - limit int
971// - offset int
972func (_e *MockHistoryRepository_Expecter) GetRecentByDomain(ctx any, domain any, limit any, offset any) *MockHistoryRepository_GetRecentByDomain_Call {
973 return &MockHistoryRepository_GetRecentByDomain_Call{Call: _e.mock.On("GetRecentByDomain", ctx, domain, limit, offset)}
974}
975
976func (_c *MockHistoryRepository_GetRecentByDomain_Call) Run(run func(ctx context.Context, domain string, limit int, offset int)) *MockHistoryRepository_GetRecentByDomain_Call {
977 _c.Call.Run(func(args mock.Arguments) {
978 var arg0 context.Context
979 if args[0] != nil {
980 arg0 = args[0].(context.Context)
981 }
982 var arg1 string
983 if args[1] != nil {
984 arg1 = args[1].(string)
985 }
986 var arg2 int
987 if args[2] != nil {
988 arg2 = args[2].(int)
989 }
990 var arg3 int
991 if args[3] != nil {
992 arg3 = args[3].(int)
993 }
994 run(
995 arg0,
996 arg1,
997 arg2,
998 arg3,
999 )
1000 })
1001 return _c
1002}
1003
1004func (_c *MockHistoryRepository_GetRecentByDomain_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentByDomain_Call {
1005 _c.Call.Return(historyEntrys, err)
1006 return _c
1007}
1008
1009func (_c *MockHistoryRepository_GetRecentByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string, limit int, offset int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentByDomain_Call {
1010 _c.Call.Return(run)
1011 return _c
1012}
1013
1014// GetRecentSince provides a mock function for the type MockHistoryRepository
1015func (_mock *MockHistoryRepository) GetRecentSince(ctx context.Context, days int) ([]*entity.HistoryEntry, error) {
1016 ret := _mock.Called(ctx, days)
1017
1018 if len(ret) == 0 {
1019 panic("no return value specified for GetRecentSince")
1020 }
1021
1022 var r0 []*entity.HistoryEntry
1023 var r1 error
1024 if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.HistoryEntry, error)); ok {
1025 return returnFunc(ctx, days)
1026 }
1027 if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.HistoryEntry); ok {
1028 r0 = returnFunc(ctx, days)
1029 } else {
1030 if ret.Get(0) != nil {
1031 r0 = ret.Get(0).([]*entity.HistoryEntry)
1032 }
1033 }
1034 if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok {
1035 r1 = returnFunc(ctx, days)
1036 } else {
1037 r1 = ret.Error(1)
1038 }
1039 return r0, r1
1040}
1041
1042// MockHistoryRepository_GetRecentSince_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentSince'
1043type MockHistoryRepository_GetRecentSince_Call struct {
1044 *mock.Call
1045}
1046
1047// GetRecentSince is a helper method to define mock.On call
1048// - ctx context.Context
1049// - days int
1050func (_e *MockHistoryRepository_Expecter) GetRecentSince(ctx any, days any) *MockHistoryRepository_GetRecentSince_Call {
1051 return &MockHistoryRepository_GetRecentSince_Call{Call: _e.mock.On("GetRecentSince", ctx, days)}
1052}
1053
1054func (_c *MockHistoryRepository_GetRecentSince_Call) Run(run func(ctx context.Context, days int)) *MockHistoryRepository_GetRecentSince_Call {
1055 _c.Call.Run(func(args mock.Arguments) {
1056 var arg0 context.Context
1057 if args[0] != nil {
1058 arg0 = args[0].(context.Context)
1059 }
1060 var arg1 int
1061 if args[1] != nil {
1062 arg1 = args[1].(int)
1063 }
1064 run(
1065 arg0,
1066 arg1,
1067 )
1068 })
1069 return _c
1070}
1071
1072func (_c *MockHistoryRepository_GetRecentSince_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentSince_Call {
1073 _c.Call.Return(historyEntrys, err)
1074 return _c
1075}
1076
1077func (_c *MockHistoryRepository_GetRecentSince_Call) RunAndReturn(run func(ctx context.Context, days int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentSince_Call {
1078 _c.Call.Return(run)
1079 return _c
1080}
1081
1082// GetRecentWindow provides a mock function for the type MockHistoryRepository
1083func (_mock *MockHistoryRepository) GetRecentWindow(ctx context.Context, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error) {
1084 ret := _mock.Called(ctx, before, beforeID, limit)
1085
1086 if len(ret) == 0 {
1087 panic("no return value specified for GetRecentWindow")
1088 }
1089
1090 var r0 []*entity.HistoryEntry
1091 var r1 error
1092 if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time, int64, int) ([]*entity.HistoryEntry, error)); ok {
1093 return returnFunc(ctx, before, beforeID, limit)
1094 }
1095 if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time, int64, int) []*entity.HistoryEntry); ok {
1096 r0 = returnFunc(ctx, before, beforeID, limit)
1097 } else {
1098 if ret.Get(0) != nil {
1099 r0 = ret.Get(0).([]*entity.HistoryEntry)
1100 }
1101 }
1102 if returnFunc, ok := ret.Get(1).(func(context.Context, time.Time, int64, int) error); ok {
1103 r1 = returnFunc(ctx, before, beforeID, limit)
1104 } else {
1105 r1 = ret.Error(1)
1106 }
1107 return r0, r1
1108}
1109
1110// MockHistoryRepository_GetRecentWindow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentWindow'
1111type MockHistoryRepository_GetRecentWindow_Call struct {
1112 *mock.Call
1113}
1114
1115// GetRecentWindow is a helper method to define mock.On call
1116// - ctx context.Context
1117// - before time.Time
1118// - beforeID int64
1119// - limit int
1120func (_e *MockHistoryRepository_Expecter) GetRecentWindow(ctx any, before any, beforeID any, limit any) *MockHistoryRepository_GetRecentWindow_Call {
1121 return &MockHistoryRepository_GetRecentWindow_Call{Call: _e.mock.On("GetRecentWindow", ctx, before, beforeID, limit)}
1122}
1123
1124func (_c *MockHistoryRepository_GetRecentWindow_Call) Run(run func(ctx context.Context, before time.Time, beforeID int64, limit int)) *MockHistoryRepository_GetRecentWindow_Call {
1125 _c.Call.Run(func(args mock.Arguments) {
1126 var arg0 context.Context
1127 if args[0] != nil {
1128 arg0 = args[0].(context.Context)
1129 }
1130 var arg1 time.Time
1131 if args[1] != nil {
1132 arg1 = args[1].(time.Time)
1133 }
1134 var arg2 int64
1135 if args[2] != nil {
1136 arg2 = args[2].(int64)
1137 }
1138 var arg3 int
1139 if args[3] != nil {
1140 arg3 = args[3].(int)
1141 }
1142 run(
1143 arg0,
1144 arg1,
1145 arg2,
1146 arg3,
1147 )
1148 })
1149 return _c
1150}
1151
1152func (_c *MockHistoryRepository_GetRecentWindow_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentWindow_Call {
1153 _c.Call.Return(historyEntrys, err)
1154 return _c
1155}
1156
1157func (_c *MockHistoryRepository_GetRecentWindow_Call) RunAndReturn(run func(ctx context.Context, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecentWindow_Call {
1158 _c.Call.Return(run)
1159 return _c
1160}
1161
1162// GetRecentWindowByDomain provides a mock function for the type MockHistoryRepository
1163func (_mock *MockHistoryRepository) GetRecentWindowByDomain(ctx context.Context, domain string, before time.Time, beforeID int64, limit int) ([]*entity.HistoryEntry, error) {
1164 ret := _mock.Called(ctx, domain, before, beforeID, limit)
1165
1166 if len(ret) == 0 {
1167 panic("no return value specified for GetRecentWindowByDomain")
1168 }
1169
1170 var r0 []*entity.HistoryEntry
1171 var r1 error
1172 if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time, int64, int) ([]*entity.HistoryEntry, error)); ok {
1173 return returnFunc(ctx, domain, before, beforeID, limit)
1174 }
1175 if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time, int64, int) []*entity.HistoryEntry); ok {
1176 r0 = returnFunc(ctx, domain, before, beforeID, limit)
1177 } else {
1178 if ret.Get(0) != nil {
1179 r0 = ret.Get(0).([]*entity.HistoryEntry)
1180 }
1181 }
1182 if returnFunc, ok := ret.Get(1).(func(context.Context, string, time.Time, int64, int) error); ok {
1183 r1 = returnFunc(ctx, domain, before, beforeID, limit)
1184 } else {
1185 r1 = ret.Error(1)
1186 }
1187 return r0, r1
1188}
1189
1190// MockHistoryRepository_GetRecentWindowByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecentWindowByDomain'
1191type MockHistoryRepository_GetRecentWindowByDomain_Call struct {
1192 *mock.Call
1193}
1194
1195// GetRecentWindowByDomain is a helper method to define mock.On call
1196// - ctx context.Context
1197// - domain string
1198// - before time.Time
1199// - beforeID int64
1200// - limit int
1201func (_e *MockHistoryRepository_Expecter) GetRecentWindowByDomain(ctx any, domain any, before any, beforeID any, limit any) *MockHistoryRepository_GetRecentWindowByDomain_Call {
1202 return &MockHistoryRepository_GetRecentWindowByDomain_Call{Call: _e.mock.On("GetRecentWindowByDomain", ctx, domain, before, beforeID, limit)}
1203}
1204
1205func (_c *MockHistoryRepository_GetRecentWindowByDomain_Call) Run(run func(ctx context.Context, domain string, before time.Time, beforeID int64, limit int)) *MockHistoryRepository_GetRecentWindowByDomain_Call {
1206 _c.Call.Run(func(args mock.Arguments) {
1207 var arg0 context.Context
1208 if args[0] != nil {
1209 arg0 = args[0].(context.Context)
1210 }
1211 var arg1 string
1212 if args[1] != nil {
1213 arg1 = args[1].(string)
1214 }
1215 var arg2 time.Time
1216 if args[2] != nil {
1217 arg2 = args[2].(time.Time)
1218 }
1219 var arg3 int64
1220 if args[3] != nil {
1221 arg3 = args[3].(int64)
1222 }
1223 var arg4 int
1224 if args[4] != nil {
1225 arg4 = args[4].(int)
1226 }
1227 run(
1228 arg0,
1229 arg1,
1230 arg2,
1231 arg3,
1232 arg4,
1233 )
1234 })
1235 return _c
1236}
1237
1238func (_c *MockHistoryRepository_GetRecentWindowByDomain_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecentWindowByDomain_Call {
1239 _c.Call.Return(historyEntrys, err)
1240 return _c
1241}
1242
1243func (_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 {
1244 _c.Call.Return(run)
1245 return _c
1246}
1247
1248// GetStats provides a mock function for the type MockHistoryRepository
1249func (_mock *MockHistoryRepository) GetStats(ctx context.Context) (*entity.HistoryStats, error) {
1250 ret := _mock.Called(ctx)
1251
1252 if len(ret) == 0 {
1253 panic("no return value specified for GetStats")
1254 }
1255
1256 var r0 *entity.HistoryStats
1257 var r1 error
1258 if returnFunc, ok := ret.Get(0).(func(context.Context) (*entity.HistoryStats, error)); ok {
1259 return returnFunc(ctx)
1260 }
1261 if returnFunc, ok := ret.Get(0).(func(context.Context) *entity.HistoryStats); ok {
1262 r0 = returnFunc(ctx)
1263 } else {
1264 if ret.Get(0) != nil {
1265 r0 = ret.Get(0).(*entity.HistoryStats)
1266 }
1267 }
1268 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
1269 r1 = returnFunc(ctx)
1270 } else {
1271 r1 = ret.Error(1)
1272 }
1273 return r0, r1
1274}
1275
1276// MockHistoryRepository_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats'
1277type MockHistoryRepository_GetStats_Call struct {
1278 *mock.Call
1279}
1280
1281// GetStats is a helper method to define mock.On call
1282// - ctx context.Context
1283func (_e *MockHistoryRepository_Expecter) GetStats(ctx any) *MockHistoryRepository_GetStats_Call {
1284 return &MockHistoryRepository_GetStats_Call{Call: _e.mock.On("GetStats", ctx)}
1285}
1286
1287func (_c *MockHistoryRepository_GetStats_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetStats_Call {
1288 _c.Call.Run(func(args mock.Arguments) {
1289 var arg0 context.Context
1290 if args[0] != nil {
1291 arg0 = args[0].(context.Context)
1292 }
1293 run(
1294 arg0,
1295 )
1296 })
1297 return _c
1298}
1299
1300func (_c *MockHistoryRepository_GetStats_Call) Return(historyStats *entity.HistoryStats, err error) *MockHistoryRepository_GetStats_Call {
1301 _c.Call.Return(historyStats, err)
1302 return _c
1303}
1304
1305func (_c *MockHistoryRepository_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*entity.HistoryStats, error)) *MockHistoryRepository_GetStats_Call {
1306 _c.Call.Return(run)
1307 return _c
1308}
1309
1310// IncrementVisitCount provides a mock function for the type MockHistoryRepository
1311func (_mock *MockHistoryRepository) IncrementVisitCount(ctx context.Context, url string) error {
1312 ret := _mock.Called(ctx, url)
1313
1314 if len(ret) == 0 {
1315 panic("no return value specified for IncrementVisitCount")
1316 }
1317
1318 var r0 error
1319 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
1320 r0 = returnFunc(ctx, url)
1321 } else {
1322 r0 = ret.Error(0)
1323 }
1324 return r0
1325}
1326
1327// MockHistoryRepository_IncrementVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementVisitCount'
1328type MockHistoryRepository_IncrementVisitCount_Call struct {
1329 *mock.Call
1330}
1331
1332// IncrementVisitCount is a helper method to define mock.On call
1333// - ctx context.Context
1334// - url string
1335func (_e *MockHistoryRepository_Expecter) IncrementVisitCount(ctx any, url any) *MockHistoryRepository_IncrementVisitCount_Call {
1336 return &MockHistoryRepository_IncrementVisitCount_Call{Call: _e.mock.On("IncrementVisitCount", ctx, url)}
1337}
1338
1339func (_c *MockHistoryRepository_IncrementVisitCount_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_IncrementVisitCount_Call {
1340 _c.Call.Run(func(args mock.Arguments) {
1341 var arg0 context.Context
1342 if args[0] != nil {
1343 arg0 = args[0].(context.Context)
1344 }
1345 var arg1 string
1346 if args[1] != nil {
1347 arg1 = args[1].(string)
1348 }
1349 run(
1350 arg0,
1351 arg1,
1352 )
1353 })
1354 return _c
1355}
1356
1357func (_c *MockHistoryRepository_IncrementVisitCount_Call) Return(err error) *MockHistoryRepository_IncrementVisitCount_Call {
1358 _c.Call.Return(err)
1359 return _c
1360}
1361
1362func (_c *MockHistoryRepository_IncrementVisitCount_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockHistoryRepository_IncrementVisitCount_Call {
1363 _c.Call.Return(run)
1364 return _c
1365}
1366
1367// Save provides a mock function for the type MockHistoryRepository
1368func (_mock *MockHistoryRepository) Save(ctx context.Context, entry *entity.HistoryEntry) error {
1369 ret := _mock.Called(ctx, entry)
1370
1371 if len(ret) == 0 {
1372 panic("no return value specified for Save")
1373 }
1374
1375 var r0 error
1376 if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.HistoryEntry) error); ok {
1377 r0 = returnFunc(ctx, entry)
1378 } else {
1379 r0 = ret.Error(0)
1380 }
1381 return r0
1382}
1383
1384// MockHistoryRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
1385type MockHistoryRepository_Save_Call struct {
1386 *mock.Call
1387}
1388
1389// Save is a helper method to define mock.On call
1390// - ctx context.Context
1391// - entry *entity.HistoryEntry
1392func (_e *MockHistoryRepository_Expecter) Save(ctx any, entry any) *MockHistoryRepository_Save_Call {
1393 return &MockHistoryRepository_Save_Call{Call: _e.mock.On("Save", ctx, entry)}
1394}
1395
1396func (_c *MockHistoryRepository_Save_Call) Run(run func(ctx context.Context, entry *entity.HistoryEntry)) *MockHistoryRepository_Save_Call {
1397 _c.Call.Run(func(args mock.Arguments) {
1398 var arg0 context.Context
1399 if args[0] != nil {
1400 arg0 = args[0].(context.Context)
1401 }
1402 var arg1 *entity.HistoryEntry
1403 if args[1] != nil {
1404 arg1 = args[1].(*entity.HistoryEntry)
1405 }
1406 run(
1407 arg0,
1408 arg1,
1409 )
1410 })
1411 return _c
1412}
1413
1414func (_c *MockHistoryRepository_Save_Call) Return(err error) *MockHistoryRepository_Save_Call {
1415 _c.Call.Return(err)
1416 return _c
1417}
1418
1419func (_c *MockHistoryRepository_Save_Call) RunAndReturn(run func(ctx context.Context, entry *entity.HistoryEntry) error) *MockHistoryRepository_Save_Call {
1420 _c.Call.Return(run)
1421 return _c
1422}
1423
1424// Search provides a mock function for the type MockHistoryRepository
1425func (_mock *MockHistoryRepository) Search(ctx context.Context, query string, limit int, scope repository.HistoryScope) ([]entity.HistoryMatch, error) {
1426 ret := _mock.Called(ctx, query, limit, scope)
1427
1428 if len(ret) == 0 {
1429 panic("no return value specified for Search")
1430 }
1431
1432 var r0 []entity.HistoryMatch
1433 var r1 error
1434 if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, repository.HistoryScope) ([]entity.HistoryMatch, error)); ok {
1435 return returnFunc(ctx, query, limit, scope)
1436 }
1437 if returnFunc, ok := ret.Get(0).(func(context.Context, string, int, repository.HistoryScope) []entity.HistoryMatch); ok {
1438 r0 = returnFunc(ctx, query, limit, scope)
1439 } else {
1440 if ret.Get(0) != nil {
1441 r0 = ret.Get(0).([]entity.HistoryMatch)
1442 }
1443 }
1444 if returnFunc, ok := ret.Get(1).(func(context.Context, string, int, repository.HistoryScope) error); ok {
1445 r1 = returnFunc(ctx, query, limit, scope)
1446 } else {
1447 r1 = ret.Error(1)
1448 }
1449 return r0, r1
1450}
1451
1452// MockHistoryRepository_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
1453type MockHistoryRepository_Search_Call struct {
1454 *mock.Call
1455}
1456
1457// Search is a helper method to define mock.On call
1458// - ctx context.Context
1459// - query string
1460// - limit int
1461// - scope repository.HistoryScope
1462func (_e *MockHistoryRepository_Expecter) Search(ctx any, query any, limit any, scope any) *MockHistoryRepository_Search_Call {
1463 return &MockHistoryRepository_Search_Call{Call: _e.mock.On("Search", ctx, query, limit, scope)}
1464}
1465
1466func (_c *MockHistoryRepository_Search_Call) Run(run func(ctx context.Context, query string, limit int, scope repository.HistoryScope)) *MockHistoryRepository_Search_Call {
1467 _c.Call.Run(func(args mock.Arguments) {
1468 var arg0 context.Context
1469 if args[0] != nil {
1470 arg0 = args[0].(context.Context)
1471 }
1472 var arg1 string
1473 if args[1] != nil {
1474 arg1 = args[1].(string)
1475 }
1476 var arg2 int
1477 if args[2] != nil {
1478 arg2 = args[2].(int)
1479 }
1480 var arg3 repository.HistoryScope
1481 if args[3] != nil {
1482 arg3 = args[3].(repository.HistoryScope)
1483 }
1484 run(
1485 arg0,
1486 arg1,
1487 arg2,
1488 arg3,
1489 )
1490 })
1491 return _c
1492}
1493
1494func (_c *MockHistoryRepository_Search_Call) Return(historyMatchs []entity.HistoryMatch, err error) *MockHistoryRepository_Search_Call {
1495 _c.Call.Return(historyMatchs, err)
1496 return _c
1497}
1498
1499func (_c *MockHistoryRepository_Search_Call) RunAndReturn(run func(ctx context.Context, query string, limit int, scope repository.HistoryScope) ([]entity.HistoryMatch, error)) *MockHistoryRepository_Search_Call {
1500 _c.Call.Return(run)
1501 return _c
1502}