Versions in this module Expand all Collapse all v10 v10.0.1 Apr 2, 2023 v10.0.0 Jan 24, 2023 Changes in this version + type Limit struct + Burst int + Period time.Duration + Rate int + func PerHour(rate int) Limit + func PerMinute(rate int) Limit + func PerSecond(rate int) Limit + func (l Limit) IsZero() bool + func (l Limit) String() string + type Limiter struct + func NewLimiter(rdb rediser) *Limiter + func (l *Limiter) Reset(ctx context.Context, key string) error + func (l Limiter) Allow(ctx context.Context, key string, limit Limit) (*Result, error) + func (l Limiter) AllowAtMost(ctx context.Context, key string, limit Limit, n int) (*Result, error) + func (l Limiter) AllowN(ctx context.Context, key string, limit Limit, n int) (*Result, error) + type Result struct + Allowed int + Limit Limit + Remaining int + ResetAfter time.Duration + RetryAfter time.Duration Other modules containing this package github.com/go-redis/redis_rate github.com/go-redis/redis_rate/v7 github.com/go-redis/redis_rate/v8 github.com/go-redis/redis_rate/v9