Documentation
¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_WINDOW = 60 DEFAULT_LIMIT = 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserCounter ¶
type UserCounter struct {
// contains filtered or unexported fields
}
type WindowCounter ¶
type WindowCounter struct {
// contains filtered or unexported fields
}
WindowCounter implements a simple window counter
func NewWindowCounter ¶
func NewWindowCounter(windowSeconds, limit int) *WindowCounter
func (*WindowCounter) Allow ¶
func (rl *WindowCounter) Allow(userID string) bool
Click to show internal directories.
Click to hide internal directories.