ratelimiter

package
v0.0.0-...-02d2a03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter interface {
	// Limit 是否达到限流阈值
	Limit(ctx context.Context, key string) (limited bool, err error)
}

func NewRedisSlideWindowLimiter

func NewRedisSlideWindowLimiter(cmd redis.Cmdable, interval time.Duration, rate int) Limiter

type RedisSlideWindowLimiter

type RedisSlideWindowLimiter struct {
	// contains filtered or unexported fields
}

func (*RedisSlideWindowLimiter) Limit

func (l *RedisSlideWindowLimiter) Limit(ctx context.Context, key string) (limited bool, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL