Documentation ¶
Index ¶
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(timeDuration time.Duration, rate int64) *FixWindowLimiter
func (*FixWindowLimiter) Build ¶
func (f *FixWindowLimiter) Build() grpc.UnaryServerInterceptor
type SlideWindowLimiter ¶
type SlideWindowLimiter struct {
// contains filtered or unexported fields
}
func NewSlideWindowLimiter ¶
func NewSlideWindowLimiter(interval time.Duration, rate int) *SlideWindowLimiter
func (*SlideWindowLimiter) Build ¶
func (s *SlideWindowLimiter) Build() grpc.UnaryServerInterceptor
type TokenBucketLimiter ¶
type TokenBucketLimiter struct {
// contains filtered or unexported fields
}
令牌桶
func NewTokenBucketLimiter ¶
func NewTokenBucketLimiter(capacity int, interval time.Duration) *TokenBucketLimiter
func (*TokenBucketLimiter) Build ¶
func (t *TokenBucketLimiter) Build() grpc.UnaryServerInterceptor
func (*TokenBucketLimiter) Close ¶
func (t *TokenBucketLimiter) Close()
Click to show internal directories.
Click to hide internal directories.