Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRandomToken ¶
func RejectBannedIPs ¶
func RejectBannedIPs(bannedIPs *MaxBadAttemptsBanList) mux.MiddlewareFunc
Types ¶
type MaxBadAttemptsBanList ¶
type MaxBadAttemptsBanList struct {
// contains filtered or unexported fields
}
MaxBadAttemptsBanList bans visitors by their keys after N failed consecutive attempts for Z period.
func (*MaxBadAttemptsBanList) AddBadAttempt ¶
func (l *MaxBadAttemptsBanList) AddBadAttempt(visitorKey string)
AddBadAttempt registers a bad attempt of a visitor.
func (*MaxBadAttemptsBanList) AddSuccessAttempt ¶
func (l *MaxBadAttemptsBanList) AddSuccessAttempt(visitorKey string)
AddSuccessAttempt registers a successful attempt of a visitor.
func (*MaxBadAttemptsBanList) IsBanned ¶
func (l *MaxBadAttemptsBanList) IsBanned(visitorKey string) bool
IsBanned checks whether a given visitor is banned or not.
Click to show internal directories.
Click to hide internal directories.