Documentation ¶
Overview ¶
Reference uber ratelimit, the different is support no wait take func
Package leakybucket is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLimiter ¶
func NewLimiter() *leakyBucketLimiter
Types ¶
type LeakyBucket ¶
func NewLeakyBucket ¶
func NewLeakyBucket(rate, volume int, opts ...Option) LeakyBucket
type MockLeakyBucket ¶
type MockLeakyBucket struct {
// contains filtered or unexported fields
}
MockLeakyBucket is a mock of LeakyBucket interface.
func NewMockLeakyBucket ¶
func NewMockLeakyBucket(ctrl *gomock.Controller) *MockLeakyBucket
NewMockLeakyBucket creates a new mock instance.
func (*MockLeakyBucket) EXPECT ¶
func (m *MockLeakyBucket) EXPECT() *MockLeakyBucketMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLeakyBucket) SetRate ¶
func (m *MockLeakyBucket) SetRate(rate int)
SetRate mocks base method.
func (*MockLeakyBucket) SetVolume ¶
func (m *MockLeakyBucket) SetVolume(volume int)
SetVolume mocks base method.
type MockLeakyBucketMockRecorder ¶
type MockLeakyBucketMockRecorder struct {
// contains filtered or unexported fields
}
MockLeakyBucketMockRecorder is the mock recorder for MockLeakyBucket.
func (*MockLeakyBucketMockRecorder) Allow ¶
func (mr *MockLeakyBucketMockRecorder) Allow() *gomock.Call
Allow indicates an expected call of Allow.
func (*MockLeakyBucketMockRecorder) SetRate ¶
func (mr *MockLeakyBucketMockRecorder) SetRate(rate interface{}) *gomock.Call
SetRate indicates an expected call of SetRate.
func (*MockLeakyBucketMockRecorder) SetVolume ¶
func (mr *MockLeakyBucketMockRecorder) SetVolume(volume interface{}) *gomock.Call
SetVolume indicates an expected call of SetVolume.
Click to show internal directories.
Click to hide internal directories.