github.com/goravel/framework@v1.13.9/contracts/http/mocks/RateLimiter.go (about) 1 // Code generated by mockery v2.14.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 http "github.com/goravel/framework/contracts/http" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // RateLimiter is an autogenerated mock type for the RateLimiter type 11 type RateLimiter struct { 12 mock.Mock 13 } 14 15 // For provides a mock function with given fields: name, callback 16 func (_m *RateLimiter) For(name string, callback func(http.Context) http.Limit) { 17 _m.Called(name, callback) 18 } 19 20 // ForWithLimits provides a mock function with given fields: name, callback 21 func (_m *RateLimiter) ForWithLimits(name string, callback func(http.Context) []http.Limit) { 22 _m.Called(name, callback) 23 } 24 25 // Limiter provides a mock function with given fields: name 26 func (_m *RateLimiter) Limiter(name string) func(http.Context) []http.Limit { 27 ret := _m.Called(name) 28 29 var r0 func(http.Context) []http.Limit 30 if rf, ok := ret.Get(0).(func(string) func(http.Context) []http.Limit); ok { 31 r0 = rf(name) 32 } else { 33 if ret.Get(0) != nil { 34 r0 = ret.Get(0).(func(http.Context) []http.Limit) 35 } 36 } 37 38 return r0 39 } 40 41 type mockConstructorTestingTNewRateLimiter interface { 42 mock.TestingT 43 Cleanup(func()) 44 } 45 46 // NewRateLimiter creates a new instance of RateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 47 func NewRateLimiter(t mockConstructorTestingTNewRateLimiter) *RateLimiter { 48 mock := &RateLimiter{} 49 mock.Mock.Test(t) 50 51 t.Cleanup(func() { mock.AssertExpectations(t) }) 52 53 return mock 54 }