Documentation ¶
Index ¶
- type FixWindowLimiter
- type FixWindowLimiterOptions
- type LeakyBucketLimiter
- type LeakyBucketLimiterOptions
- type Limiter
- type RedisFixWindowLimiter
- type RedisFixWindowLimiterOptions
- type RedisSlideWindowLimiter
- type RedisSlideWindowLimiterOptions
- type SlideWindowLimiter
- type SlideWindowLimiterOptions
- type TokenBucketLimiter
- type TokenBucketLimiterOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixWindowLimiter ¶
type FixWindowLimiter struct {
// contains filtered or unexported fields
}
func NewFixWindowLimiter ¶
func NewFixWindowLimiter(interval time.Duration, rate int64) *FixWindowLimiter
func (*FixWindowLimiter) LimitUnary ¶
func (l *FixWindowLimiter) LimitUnary() grpc.UnaryServerInterceptor
type FixWindowLimiterOptions ¶
type FixWindowLimiterOptions func(l *FixWindowLimiter)
func FixWindowMarkFailed ¶
func FixWindowMarkFailed() FixWindowLimiterOptions
type LeakyBucketLimiter ¶
type LeakyBucketLimiter struct {
// contains filtered or unexported fields
}
func NewLeakyBucketLimiter ¶
func NewLeakyBucketLimiter(interval time.Duration) *LeakyBucketLimiter
func (*LeakyBucketLimiter) Close ¶
func (l *LeakyBucketLimiter) Close() error
func (*LeakyBucketLimiter) LimitUnary ¶
func (l *LeakyBucketLimiter) LimitUnary() grpc.UnaryServerInterceptor
type LeakyBucketLimiterOptions ¶
type LeakyBucketLimiterOptions func(l *LeakyBucketLimiter)
func LeakyBucketMarkFailed ¶
func LeakyBucketMarkFailed() LeakyBucketLimiterOptions
type Limiter ¶
type Limiter interface {
LimitUnary() grpc.UnaryServerInterceptor
}
type RedisFixWindowLimiter ¶
type RedisFixWindowLimiter struct {
// contains filtered or unexported fields
}
func NewRedisFixWindowLimiter ¶
func NewRedisFixWindowLimiter(client redis.Cmdable, service string, interval time.Duration, rate int) *RedisFixWindowLimiter
func NewRedisSlideWindowLimiter ¶
func NewRedisSlideWindowLimiter(client redis.Cmdable, service string, interval time.Duration, rate int) *RedisFixWindowLimiter
func (*RedisFixWindowLimiter) LimitUnary ¶
func (l *RedisFixWindowLimiter) LimitUnary() grpc.UnaryServerInterceptor
type RedisFixWindowLimiterOptions ¶
type RedisFixWindowLimiterOptions func(l *RedisFixWindowLimiter)
func RedisFixWindowMarkFailed ¶
func RedisFixWindowMarkFailed() RedisFixWindowLimiterOptions
type RedisSlideWindowLimiter ¶
type RedisSlideWindowLimiter struct {
// contains filtered or unexported fields
}
func (*RedisSlideWindowLimiter) LimitUnary ¶
func (l *RedisSlideWindowLimiter) LimitUnary() grpc.UnaryServerInterceptor
type RedisSlideWindowLimiterOptions ¶
type RedisSlideWindowLimiterOptions func(l *RedisSlideWindowLimiter)
func RedisSlideWindowMarkFailed ¶
func RedisSlideWindowMarkFailed() RedisSlideWindowLimiterOptions
type SlideWindowLimiter ¶
type SlideWindowLimiter struct {
// contains filtered or unexported fields
}
func NewSlideWindowLimiter ¶
func NewSlideWindowLimiter(interval time.Duration, rate int) *SlideWindowLimiter
func (*SlideWindowLimiter) LimitUnary ¶
func (l *SlideWindowLimiter) LimitUnary() grpc.UnaryServerInterceptor
type SlideWindowLimiterOptions ¶
type SlideWindowLimiterOptions func(l *SlideWindowLimiter)
func SlideWindowMarkFailed ¶
func SlideWindowMarkFailed() SlideWindowLimiterOptions
type TokenBucketLimiter ¶
type TokenBucketLimiter struct {
// contains filtered or unexported fields
}
func NewTokenBucketLimiter ¶
func NewTokenBucketLimiter(capacity int, interval time.Duration) *TokenBucketLimiter
func (*TokenBucketLimiter) Close ¶
func (l *TokenBucketLimiter) Close() error
func (*TokenBucketLimiter) LimitUnary ¶
func (l *TokenBucketLimiter) LimitUnary() grpc.UnaryServerInterceptor
type TokenBucketLimiterOptions ¶
type TokenBucketLimiterOptions func(l *TokenBucketLimiter)
func TokenBucketMarkFailed ¶
func TokenBucketMarkFailed() TokenBucketLimiterOptions
Click to show internal directories.
Click to hide internal directories.