github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/basic_rate_limiter.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 irrecoverable "github.com/onflow/flow-go/module/irrecoverable" 7 mock "github.com/stretchr/testify/mock" 8 9 peer "github.com/libp2p/go-libp2p/core/peer" 10 ) 11 12 // BasicRateLimiter is an autogenerated mock type for the BasicRateLimiter type 13 type BasicRateLimiter struct { 14 mock.Mock 15 } 16 17 // Allow provides a mock function with given fields: peerID, msgSize 18 func (_m *BasicRateLimiter) Allow(peerID peer.ID, msgSize int) bool { 19 ret := _m.Called(peerID, msgSize) 20 21 var r0 bool 22 if rf, ok := ret.Get(0).(func(peer.ID, int) bool); ok { 23 r0 = rf(peerID, msgSize) 24 } else { 25 r0 = ret.Get(0).(bool) 26 } 27 28 return r0 29 } 30 31 // Done provides a mock function with given fields: 32 func (_m *BasicRateLimiter) Done() <-chan struct{} { 33 ret := _m.Called() 34 35 var r0 <-chan struct{} 36 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 37 r0 = rf() 38 } else { 39 if ret.Get(0) != nil { 40 r0 = ret.Get(0).(<-chan struct{}) 41 } 42 } 43 44 return r0 45 } 46 47 // Ready provides a mock function with given fields: 48 func (_m *BasicRateLimiter) Ready() <-chan struct{} { 49 ret := _m.Called() 50 51 var r0 <-chan struct{} 52 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 53 r0 = rf() 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).(<-chan struct{}) 57 } 58 } 59 60 return r0 61 } 62 63 // Start provides a mock function with given fields: _a0 64 func (_m *BasicRateLimiter) Start(_a0 irrecoverable.SignalerContext) { 65 _m.Called(_a0) 66 } 67 68 type mockConstructorTestingTNewBasicRateLimiter interface { 69 mock.TestingT 70 Cleanup(func()) 71 } 72 73 // NewBasicRateLimiter creates a new instance of BasicRateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 74 func NewBasicRateLimiter(t mockConstructorTestingTNewBasicRateLimiter) *BasicRateLimiter { 75 mock := &BasicRateLimiter{} 76 mock.Mock.Test(t) 77 78 t.Cleanup(func() { mock.AssertExpectations(t) }) 79 80 return mock 81 }