1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 "bnema.dev/ermite/internal/ports"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewCILogStore creates a new instance of CILogStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewCILogStore(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *CILogStore {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &CILogStore{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// CILogStore is an autogenerated mock type for the CILogStore type
39type CILogStore struct {
40 mock.Mock
41}
42
43type CILogStore_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *CILogStore) EXPECT() *CILogStore_Expecter {
48 return &CILogStore_Expecter{mock: &_m.Mock}
49}
50
51// Append provides a mock function for the type CILogStore
52func (_mock *CILogStore) Append(ctx context.Context, ref ports.CILogRef, offset int64, lines []domain.CILogLine, limit int64) (int64, int, error) {
53 ret := _mock.Called(ctx, ref, offset, lines, limit)
54
55 if len(ret) == 0 {
56 panic("no return value specified for Append")
57 }
58
59 var r0 int64
60 var r1 int
61 var r2 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int64, []domain.CILogLine, int64) (int64, int, error)); ok {
63 return returnFunc(ctx, ref, offset, lines, limit)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int64, []domain.CILogLine, int64) int64); ok {
66 r0 = returnFunc(ctx, ref, offset, lines, limit)
67 } else {
68 r0 = ret.Get(0).(int64)
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CILogRef, int64, []domain.CILogLine, int64) int); ok {
71 r1 = returnFunc(ctx, ref, offset, lines, limit)
72 } else {
73 r1 = ret.Get(1).(int)
74 }
75 if returnFunc, ok := ret.Get(2).(func(context.Context, ports.CILogRef, int64, []domain.CILogLine, int64) error); ok {
76 r2 = returnFunc(ctx, ref, offset, lines, limit)
77 } else {
78 r2 = ret.Error(2)
79 }
80 return r0, r1, r2
81}
82
83// CILogStore_Append_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Append'
84type CILogStore_Append_Call struct {
85 *mock.Call
86}
87
88// Append is a helper method to define mock.On call
89// - ctx context.Context
90// - ref ports.CILogRef
91// - offset int64
92// - lines []domain.CILogLine
93// - limit int64
94func (_e *CILogStore_Expecter) Append(ctx any, ref any, offset any, lines any, limit any) *CILogStore_Append_Call {
95 return &CILogStore_Append_Call{Call: _e.mock.On("Append", ctx, ref, offset, lines, limit)}
96}
97
98func (_c *CILogStore_Append_Call) Run(run func(ctx context.Context, ref ports.CILogRef, offset int64, lines []domain.CILogLine, limit int64)) *CILogStore_Append_Call {
99 _c.Call.Run(func(args mock.Arguments) {
100 var arg0 context.Context
101 if args[0] != nil {
102 arg0 = args[0].(context.Context)
103 }
104 var arg1 ports.CILogRef
105 if args[1] != nil {
106 arg1 = args[1].(ports.CILogRef)
107 }
108 var arg2 int64
109 if args[2] != nil {
110 arg2 = args[2].(int64)
111 }
112 var arg3 []domain.CILogLine
113 if args[3] != nil {
114 arg3 = args[3].([]domain.CILogLine)
115 }
116 var arg4 int64
117 if args[4] != nil {
118 arg4 = args[4].(int64)
119 }
120 run(
121 arg0,
122 arg1,
123 arg2,
124 arg3,
125 arg4,
126 )
127 })
128 return _c
129}
130
131func (_c *CILogStore_Append_Call) Return(next int64, added int, err error) *CILogStore_Append_Call {
132 _c.Call.Return(next, added, err)
133 return _c
134}
135
136func (_c *CILogStore_Append_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef, offset int64, lines []domain.CILogLine, limit int64) (int64, int, error)) *CILogStore_Append_Call {
137 _c.Call.Return(run)
138 return _c
139}
140
141// AppendForced provides a mock function for the type CILogStore
142func (_mock *CILogStore) AppendForced(ctx context.Context, ref ports.CILogRef, lines []domain.CILogLine) (int64, error) {
143 ret := _mock.Called(ctx, ref, lines)
144
145 if len(ret) == 0 {
146 panic("no return value specified for AppendForced")
147 }
148
149 var r0 int64
150 var r1 error
151 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, []domain.CILogLine) (int64, error)); ok {
152 return returnFunc(ctx, ref, lines)
153 }
154 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, []domain.CILogLine) int64); ok {
155 r0 = returnFunc(ctx, ref, lines)
156 } else {
157 r0 = ret.Get(0).(int64)
158 }
159 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CILogRef, []domain.CILogLine) error); ok {
160 r1 = returnFunc(ctx, ref, lines)
161 } else {
162 r1 = ret.Error(1)
163 }
164 return r0, r1
165}
166
167// CILogStore_AppendForced_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendForced'
168type CILogStore_AppendForced_Call struct {
169 *mock.Call
170}
171
172// AppendForced is a helper method to define mock.On call
173// - ctx context.Context
174// - ref ports.CILogRef
175// - lines []domain.CILogLine
176func (_e *CILogStore_Expecter) AppendForced(ctx any, ref any, lines any) *CILogStore_AppendForced_Call {
177 return &CILogStore_AppendForced_Call{Call: _e.mock.On("AppendForced", ctx, ref, lines)}
178}
179
180func (_c *CILogStore_AppendForced_Call) Run(run func(ctx context.Context, ref ports.CILogRef, lines []domain.CILogLine)) *CILogStore_AppendForced_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 ports.CILogRef
187 if args[1] != nil {
188 arg1 = args[1].(ports.CILogRef)
189 }
190 var arg2 []domain.CILogLine
191 if args[2] != nil {
192 arg2 = args[2].([]domain.CILogLine)
193 }
194 run(
195 arg0,
196 arg1,
197 arg2,
198 )
199 })
200 return _c
201}
202
203func (_c *CILogStore_AppendForced_Call) Return(next int64, err error) *CILogStore_AppendForced_Call {
204 _c.Call.Return(next, err)
205 return _c
206}
207
208func (_c *CILogStore_AppendForced_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef, lines []domain.CILogLine) (int64, error)) *CILogStore_AppendForced_Call {
209 _c.Call.Return(run)
210 return _c
211}
212
213// Changed provides a mock function for the type CILogStore
214func (_mock *CILogStore) Changed(ref ports.CILogRef) <-chan struct{} {
215 ret := _mock.Called(ref)
216
217 if len(ret) == 0 {
218 panic("no return value specified for Changed")
219 }
220
221 var r0 <-chan struct{}
222 if returnFunc, ok := ret.Get(0).(func(ports.CILogRef) <-chan struct{}); ok {
223 r0 = returnFunc(ref)
224 } else {
225 if ret.Get(0) != nil {
226 r0 = ret.Get(0).(<-chan struct{})
227 }
228 }
229 return r0
230}
231
232// CILogStore_Changed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Changed'
233type CILogStore_Changed_Call struct {
234 *mock.Call
235}
236
237// Changed is a helper method to define mock.On call
238// - ref ports.CILogRef
239func (_e *CILogStore_Expecter) Changed(ref any) *CILogStore_Changed_Call {
240 return &CILogStore_Changed_Call{Call: _e.mock.On("Changed", ref)}
241}
242
243func (_c *CILogStore_Changed_Call) Run(run func(ref ports.CILogRef)) *CILogStore_Changed_Call {
244 _c.Call.Run(func(args mock.Arguments) {
245 var arg0 ports.CILogRef
246 if args[0] != nil {
247 arg0 = args[0].(ports.CILogRef)
248 }
249 run(
250 arg0,
251 )
252 })
253 return _c
254}
255
256func (_c *CILogStore_Changed_Call) Return(valCh <-chan struct{}) *CILogStore_Changed_Call {
257 _c.Call.Return(valCh)
258 return _c
259}
260
261func (_c *CILogStore_Changed_Call) RunAndReturn(run func(ref ports.CILogRef) <-chan struct{}) *CILogStore_Changed_Call {
262 _c.Call.Return(run)
263 return _c
264}
265
266// Count provides a mock function for the type CILogStore
267func (_mock *CILogStore) Count(ctx context.Context, ref ports.CILogRef) (int64, error) {
268 ret := _mock.Called(ctx, ref)
269
270 if len(ret) == 0 {
271 panic("no return value specified for Count")
272 }
273
274 var r0 int64
275 var r1 error
276 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef) (int64, error)); ok {
277 return returnFunc(ctx, ref)
278 }
279 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef) int64); ok {
280 r0 = returnFunc(ctx, ref)
281 } else {
282 r0 = ret.Get(0).(int64)
283 }
284 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CILogRef) error); ok {
285 r1 = returnFunc(ctx, ref)
286 } else {
287 r1 = ret.Error(1)
288 }
289 return r0, r1
290}
291
292// CILogStore_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
293type CILogStore_Count_Call struct {
294 *mock.Call
295}
296
297// Count is a helper method to define mock.On call
298// - ctx context.Context
299// - ref ports.CILogRef
300func (_e *CILogStore_Expecter) Count(ctx any, ref any) *CILogStore_Count_Call {
301 return &CILogStore_Count_Call{Call: _e.mock.On("Count", ctx, ref)}
302}
303
304func (_c *CILogStore_Count_Call) Run(run func(ctx context.Context, ref ports.CILogRef)) *CILogStore_Count_Call {
305 _c.Call.Run(func(args mock.Arguments) {
306 var arg0 context.Context
307 if args[0] != nil {
308 arg0 = args[0].(context.Context)
309 }
310 var arg1 ports.CILogRef
311 if args[1] != nil {
312 arg1 = args[1].(ports.CILogRef)
313 }
314 run(
315 arg0,
316 arg1,
317 )
318 })
319 return _c
320}
321
322func (_c *CILogStore_Count_Call) Return(n int64, err error) *CILogStore_Count_Call {
323 _c.Call.Return(n, err)
324 return _c
325}
326
327func (_c *CILogStore_Count_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef) (int64, error)) *CILogStore_Count_Call {
328 _c.Call.Return(run)
329 return _c
330}
331
332// Read provides a mock function for the type CILogStore
333func (_mock *CILogStore) Read(ctx context.Context, ref ports.CILogRef, from int64, maxLines int, maxBytes int) ([]domain.CILogLine, error) {
334 ret := _mock.Called(ctx, ref, from, maxLines, maxBytes)
335
336 if len(ret) == 0 {
337 panic("no return value specified for Read")
338 }
339
340 var r0 []domain.CILogLine
341 var r1 error
342 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int64, int, int) ([]domain.CILogLine, error)); ok {
343 return returnFunc(ctx, ref, from, maxLines, maxBytes)
344 }
345 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int64, int, int) []domain.CILogLine); ok {
346 r0 = returnFunc(ctx, ref, from, maxLines, maxBytes)
347 } else {
348 if ret.Get(0) != nil {
349 r0 = ret.Get(0).([]domain.CILogLine)
350 }
351 }
352 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CILogRef, int64, int, int) error); ok {
353 r1 = returnFunc(ctx, ref, from, maxLines, maxBytes)
354 } else {
355 r1 = ret.Error(1)
356 }
357 return r0, r1
358}
359
360// CILogStore_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
361type CILogStore_Read_Call struct {
362 *mock.Call
363}
364
365// Read is a helper method to define mock.On call
366// - ctx context.Context
367// - ref ports.CILogRef
368// - from int64
369// - maxLines int
370// - maxBytes int
371func (_e *CILogStore_Expecter) Read(ctx any, ref any, from any, maxLines any, maxBytes any) *CILogStore_Read_Call {
372 return &CILogStore_Read_Call{Call: _e.mock.On("Read", ctx, ref, from, maxLines, maxBytes)}
373}
374
375func (_c *CILogStore_Read_Call) Run(run func(ctx context.Context, ref ports.CILogRef, from int64, maxLines int, maxBytes int)) *CILogStore_Read_Call {
376 _c.Call.Run(func(args mock.Arguments) {
377 var arg0 context.Context
378 if args[0] != nil {
379 arg0 = args[0].(context.Context)
380 }
381 var arg1 ports.CILogRef
382 if args[1] != nil {
383 arg1 = args[1].(ports.CILogRef)
384 }
385 var arg2 int64
386 if args[2] != nil {
387 arg2 = args[2].(int64)
388 }
389 var arg3 int
390 if args[3] != nil {
391 arg3 = args[3].(int)
392 }
393 var arg4 int
394 if args[4] != nil {
395 arg4 = args[4].(int)
396 }
397 run(
398 arg0,
399 arg1,
400 arg2,
401 arg3,
402 arg4,
403 )
404 })
405 return _c
406}
407
408func (_c *CILogStore_Read_Call) Return(cILogLines []domain.CILogLine, err error) *CILogStore_Read_Call {
409 _c.Call.Return(cILogLines, err)
410 return _c
411}
412
413func (_c *CILogStore_Read_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef, from int64, maxLines int, maxBytes int) ([]domain.CILogLine, error)) *CILogStore_Read_Call {
414 _c.Call.Return(run)
415 return _c
416}
417
418// RemoveRuns provides a mock function for the type CILogStore
419func (_mock *CILogStore) RemoveRuns(ctx context.Context, runIDs []int64) error {
420 ret := _mock.Called(ctx, runIDs)
421
422 if len(ret) == 0 {
423 panic("no return value specified for RemoveRuns")
424 }
425
426 var r0 error
427 if returnFunc, ok := ret.Get(0).(func(context.Context, []int64) error); ok {
428 r0 = returnFunc(ctx, runIDs)
429 } else {
430 r0 = ret.Error(0)
431 }
432 return r0
433}
434
435// CILogStore_RemoveRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRuns'
436type CILogStore_RemoveRuns_Call struct {
437 *mock.Call
438}
439
440// RemoveRuns is a helper method to define mock.On call
441// - ctx context.Context
442// - runIDs []int64
443func (_e *CILogStore_Expecter) RemoveRuns(ctx any, runIDs any) *CILogStore_RemoveRuns_Call {
444 return &CILogStore_RemoveRuns_Call{Call: _e.mock.On("RemoveRuns", ctx, runIDs)}
445}
446
447func (_c *CILogStore_RemoveRuns_Call) Run(run func(ctx context.Context, runIDs []int64)) *CILogStore_RemoveRuns_Call {
448 _c.Call.Run(func(args mock.Arguments) {
449 var arg0 context.Context
450 if args[0] != nil {
451 arg0 = args[0].(context.Context)
452 }
453 var arg1 []int64
454 if args[1] != nil {
455 arg1 = args[1].([]int64)
456 }
457 run(
458 arg0,
459 arg1,
460 )
461 })
462 return _c
463}
464
465func (_c *CILogStore_RemoveRuns_Call) Return(err error) *CILogStore_RemoveRuns_Call {
466 _c.Call.Return(err)
467 return _c
468}
469
470func (_c *CILogStore_RemoveRuns_Call) RunAndReturn(run func(ctx context.Context, runIDs []int64) error) *CILogStore_RemoveRuns_Call {
471 _c.Call.Return(run)
472 return _c
473}
474
475// Reset provides a mock function for the type CILogStore
476func (_mock *CILogStore) Reset(ctx context.Context, ref ports.CILogRef) error {
477 ret := _mock.Called(ctx, ref)
478
479 if len(ret) == 0 {
480 panic("no return value specified for Reset")
481 }
482
483 var r0 error
484 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef) error); ok {
485 r0 = returnFunc(ctx, ref)
486 } else {
487 r0 = ret.Error(0)
488 }
489 return r0
490}
491
492// CILogStore_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset'
493type CILogStore_Reset_Call struct {
494 *mock.Call
495}
496
497// Reset is a helper method to define mock.On call
498// - ctx context.Context
499// - ref ports.CILogRef
500func (_e *CILogStore_Expecter) Reset(ctx any, ref any) *CILogStore_Reset_Call {
501 return &CILogStore_Reset_Call{Call: _e.mock.On("Reset", ctx, ref)}
502}
503
504func (_c *CILogStore_Reset_Call) Run(run func(ctx context.Context, ref ports.CILogRef)) *CILogStore_Reset_Call {
505 _c.Call.Run(func(args mock.Arguments) {
506 var arg0 context.Context
507 if args[0] != nil {
508 arg0 = args[0].(context.Context)
509 }
510 var arg1 ports.CILogRef
511 if args[1] != nil {
512 arg1 = args[1].(ports.CILogRef)
513 }
514 run(
515 arg0,
516 arg1,
517 )
518 })
519 return _c
520}
521
522func (_c *CILogStore_Reset_Call) Return(err error) *CILogStore_Reset_Call {
523 _c.Call.Return(err)
524 return _c
525}
526
527func (_c *CILogStore_Reset_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef) error) *CILogStore_Reset_Call {
528 _c.Call.Return(run)
529 return _c
530}
531
532// RunIDs provides a mock function for the type CILogStore
533func (_mock *CILogStore) RunIDs(ctx context.Context) ([]int64, error) {
534 ret := _mock.Called(ctx)
535
536 if len(ret) == 0 {
537 panic("no return value specified for RunIDs")
538 }
539
540 var r0 []int64
541 var r1 error
542 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]int64, error)); ok {
543 return returnFunc(ctx)
544 }
545 if returnFunc, ok := ret.Get(0).(func(context.Context) []int64); ok {
546 r0 = returnFunc(ctx)
547 } else {
548 if ret.Get(0) != nil {
549 r0 = ret.Get(0).([]int64)
550 }
551 }
552 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
553 r1 = returnFunc(ctx)
554 } else {
555 r1 = ret.Error(1)
556 }
557 return r0, r1
558}
559
560// CILogStore_RunIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunIDs'
561type CILogStore_RunIDs_Call struct {
562 *mock.Call
563}
564
565// RunIDs is a helper method to define mock.On call
566// - ctx context.Context
567func (_e *CILogStore_Expecter) RunIDs(ctx any) *CILogStore_RunIDs_Call {
568 return &CILogStore_RunIDs_Call{Call: _e.mock.On("RunIDs", ctx)}
569}
570
571func (_c *CILogStore_RunIDs_Call) Run(run func(ctx context.Context)) *CILogStore_RunIDs_Call {
572 _c.Call.Run(func(args mock.Arguments) {
573 var arg0 context.Context
574 if args[0] != nil {
575 arg0 = args[0].(context.Context)
576 }
577 run(
578 arg0,
579 )
580 })
581 return _c
582}
583
584func (_c *CILogStore_RunIDs_Call) Return(int64s []int64, err error) *CILogStore_RunIDs_Call {
585 _c.Call.Return(int64s, err)
586 return _c
587}
588
589func (_c *CILogStore_RunIDs_Call) RunAndReturn(run func(ctx context.Context) ([]int64, error)) *CILogStore_RunIDs_Call {
590 _c.Call.Return(run)
591 return _c
592}