2022-10-11 22:44:11 +02:00
|
|
|
package limiter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"golang.org/x/time/rate"
|
|
|
|
)
|
|
|
|
|
2022-10-12 14:57:33 +02:00
|
|
|
const DefaultAuthLimit = 10
|
|
|
|
const DefaultAuthInterval = time.Minute
|
|
|
|
|
2022-10-11 22:44:11 +02:00
|
|
|
// Auth limits failed authentication requests (one per minute).
|
2022-10-12 14:57:33 +02:00
|
|
|
var Auth = NewLimit(rate.Every(DefaultAuthInterval), DefaultAuthLimit)
|