Documentation ¶ Index ¶ type Limiter func NewLimiter(redis *redis.Redis) *Limiter func (l *Limiter) PeriodLimit(period, quota int) *limit.PeriodLimit func (l *Limiter) Take(period, quota int, key string) bool func (l *Limiter) TakeCtx(ctx context.Context, period, quota int, key string) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Limiter ¶ type Limiter struct { // contains filtered or unexported fields } func NewLimiter ¶ func NewLimiter(redis *redis.Redis) *Limiter 获取限流器 func (*Limiter) PeriodLimit ¶ func (l *Limiter) PeriodLimit(period, quota int) *limit.PeriodLimit func (*Limiter) Take ¶ func (l *Limiter) Take(period, quota int, key string) bool func (*Limiter) TakeCtx ¶ func (l *Limiter) TakeCtx(ctx context.Context, period, quota int, key string) bool Source Files ¶ View all Source files limitx.go Click to show internal directories. Click to hide internal directories.