Documentation ¶
Overview ¶
Package leakybucket is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLimiter ¶
func NewLimiter(client *redis.Client) *leakyBucketLimiter
Types ¶
type LeakyBucket ¶
type LeakyBucket interface { Allow(ctx context.Context, key string, requestCount int) (bool, error) SetRate(rate int) SetVolume(burst int) }
func NewLeakyBucket ¶
func NewLeakyBucket(rate, volume int, client *redis.Client, 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(burst 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(ctx, key, requestCount interface{}) *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(burst interface{}) *gomock.Call
SetVolume indicates an expected call of SetVolume.
Click to show internal directories.
Click to hide internal directories.