Versions in this module Expand all Collapse all v9 v9.1.2 May 18, 2021 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/Privowny/redis_rate