// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" mock "github.com/stretchr/testify/mock" ) // NewFailureLimiter creates a new instance of FailureLimiter. 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 NewFailureLimiter(t interface { mock.TestingT Cleanup(func()) }) *FailureLimiter { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &FailureLimiter{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // FailureLimiter is an autogenerated mock type for the FailureLimiter type type FailureLimiter struct { mock.Mock } type FailureLimiter_Expecter struct { mock *mock.Mock } func (_m *FailureLimiter) EXPECT() *FailureLimiter_Expecter { return &FailureLimiter_Expecter{mock: &_m.Mock} } // Blocked provides a mock function for the type FailureLimiter func (_mock *FailureLimiter) Blocked(ctx context.Context, addr string) (bool, time.Duration) { ret := _mock.Called(ctx, addr) if len(ret) == 0 { panic("no return value specified for Blocked") } var r0 bool var r1 time.Duration if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, time.Duration)); ok { return returnFunc(ctx, addr) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok { r0 = returnFunc(ctx, addr) } else { r0 = ret.Get(0).(bool) } if returnFunc, ok := ret.Get(1).(func(context.Context, string) time.Duration); ok { r1 = returnFunc(ctx, addr) } else { r1 = ret.Get(1).(time.Duration) } return r0, r1 } // FailureLimiter_Blocked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Blocked' type FailureLimiter_Blocked_Call struct { *mock.Call } // Blocked is a helper method to define mock.On call // - ctx context.Context // - addr string func (_e *FailureLimiter_Expecter) Blocked(ctx any, addr any) *FailureLimiter_Blocked_Call { return &FailureLimiter_Blocked_Call{Call: _e.mock.On("Blocked", ctx, addr)} } func (_c *FailureLimiter_Blocked_Call) Run(run func(ctx context.Context, addr string)) *FailureLimiter_Blocked_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 *FailureLimiter_Blocked_Call) Return(b bool, duration time.Duration) *FailureLimiter_Blocked_Call { _c.Call.Return(b, duration) return _c } func (_c *FailureLimiter_Blocked_Call) RunAndReturn(run func(ctx context.Context, addr string) (bool, time.Duration)) *FailureLimiter_Blocked_Call { _c.Call.Return(run) return _c } // Fail provides a mock function for the type FailureLimiter func (_mock *FailureLimiter) Fail(ctx context.Context, addr string) { _mock.Called(ctx, addr) return } // FailureLimiter_Fail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fail' type FailureLimiter_Fail_Call struct { *mock.Call } // Fail is a helper method to define mock.On call // - ctx context.Context // - addr string func (_e *FailureLimiter_Expecter) Fail(ctx any, addr any) *FailureLimiter_Fail_Call { return &FailureLimiter_Fail_Call{Call: _e.mock.On("Fail", ctx, addr)} } func (_c *FailureLimiter_Fail_Call) Run(run func(ctx context.Context, addr string)) *FailureLimiter_Fail_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 *FailureLimiter_Fail_Call) Return() *FailureLimiter_Fail_Call { _c.Call.Return() return _c } func (_c *FailureLimiter_Fail_Call) RunAndReturn(run func(ctx context.Context, addr string)) *FailureLimiter_Fail_Call { _c.Run(run) return _c }