Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter interface { Allow(ctx context.Context, key string) (bool, error) // 是否允许请求 Wait(ctx context.Context, key string) error // 等待请求 }
func NewLimiter ¶
type Option ¶
type Option func(*Config)
func WithCleanupInterval ¶
WithCleanupInterval 设置清理过期限流器的间隔
func WithRedisClient ¶
func WithRedisClient(client *redis.Client) Option
Click to show internal directories.
Click to hide internal directories.