Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = redis_rate.PerMinute(180)
View Source
var Public = redis_rate.PerMinute(750)
View Source
var Sensitive = redis_rate.PerMinute(30)
View Source
var Unlimited = redis_rate.PerSecond(math.MaxInt)
View Source
var Zero = redis_rate.Limit{}
Functions ¶
func AnonLimitKey ¶
func AuthLimitKey ¶
Types ¶
type Limiter ¶
type Limiter interface { Limit(ctx context.Context, limitKey string, limit redis_rate.Limit) error Ping(ctx context.Context) error }
Limiter returns an error if quota per key is exceeded.
type Noop ¶
type Noop struct{}
Noop performs no rate limiting. This can be useful in local/testing environments or when rate limiting is not required.
type QuotaExceededError ¶
type QuotaExceededError struct {
// contains filtered or unexported fields
}
func NewQuotaExceededError ¶
func NewQuotaExceededError(message string) QuotaExceededError
func (QuotaExceededError) Error ¶
func (e QuotaExceededError) Error() string
Click to show internal directories.
Click to hide internal directories.