github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/rate_limiter.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	p2p "github.com/koko1123/flow-go-1/network/p2p"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	peer "github.com/libp2p/go-libp2p/core/peer"
    10  )
    11  
    12  // RateLimiter is an autogenerated mock type for the RateLimiter type
    13  type RateLimiter struct {
    14  	mock.Mock
    15  }
    16  
    17  // Allow provides a mock function with given fields: peerID, msgSize
    18  func (_m *RateLimiter) 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  // IsRateLimited provides a mock function with given fields: peerID
    32  func (_m *RateLimiter) IsRateLimited(peerID peer.ID) bool {
    33  	ret := _m.Called(peerID)
    34  
    35  	var r0 bool
    36  	if rf, ok := ret.Get(0).(func(peer.ID) bool); ok {
    37  		r0 = rf(peerID)
    38  	} else {
    39  		r0 = ret.Get(0).(bool)
    40  	}
    41  
    42  	return r0
    43  }
    44  
    45  // SetTimeNowFunc provides a mock function with given fields: now
    46  func (_m *RateLimiter) SetTimeNowFunc(now p2p.GetTimeNow) {
    47  	_m.Called(now)
    48  }
    49  
    50  // Start provides a mock function with given fields:
    51  func (_m *RateLimiter) Start() {
    52  	_m.Called()
    53  }
    54  
    55  // Stop provides a mock function with given fields:
    56  func (_m *RateLimiter) Stop() {
    57  	_m.Called()
    58  }
    59  
    60  type mockConstructorTestingTNewRateLimiter interface {
    61  	mock.TestingT
    62  	Cleanup(func())
    63  }
    64  
    65  // 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.
    66  func NewRateLimiter(t mockConstructorTestingTNewRateLimiter) *RateLimiter {
    67  	mock := &RateLimiter{}
    68  	mock.Mock.Test(t)
    69  
    70  	t.Cleanup(func() { mock.AssertExpectations(t) })
    71  
    72  	return mock
    73  }