Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RateLimitMiddleware ¶
Types ¶
type LocalLimiter ¶
type LocalLimiter struct {
// contains filtered or unexported fields
}
func NewLocalLimiter ¶
func NewLocalLimiter(policy RatePolicy) *LocalLimiter
func (*LocalLimiter) Allow ¶
func (l *LocalLimiter) Allow(key string) bool
type RatePolicy ¶
type RedisLimiter ¶
type RedisLimiter struct {
// contains filtered or unexported fields
}
func NewRedisLimiter ¶
func NewRedisLimiter(dsn string, policy RatePolicy) (*RedisLimiter, error)
func (*RedisLimiter) Allow ¶
func (l *RedisLimiter) Allow(key string) bool
Click to show internal directories.
Click to hide internal directories.