Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultRatelimit = &Ratelimit{ Current: 0, AfterClearCount: 0, TempBan: false, TempBannedAt: 0, PermBannedAt: 0, TotalBans: 0, } TempBanReset = 7 * 24 * time.Hour )
Functions ¶
This section is empty.
Types ¶
type Ratelimit ¶
type Ratelimiter ¶
type Ratelimiter struct {
Limit int
Reset int
NextReset time.Time
RPrefix string
TempBanLength time.Duration
TempBanAfter int
PermBanAfter int
}
func NewRatelimiter ¶
func NewRatelimiter(opts RatelimiterOptions) *Ratelimiter
func (*Ratelimiter) HasExpired ¶
func (r *Ratelimiter) HasExpired(ratelimit *Ratelimit) bool
Click to show internal directories.
Click to hide internal directories.