Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
History counts requests per IP for a given time window
func NewHistory ¶
func NewHistory(ctx context.Context, options *HistoryOptions) *History
NewHistory creates a new History item
func (*History) IsBlacklisted ¶
IsBlacklisted determines whether a given IP address is on the blacklist
func (*History) RequestChannel ¶
RequestChannel returns the channel through which IPs are fed to the history
type HistoryItem ¶
HistoryItem contains the request count for a given period of time denoted by Timestamp
type HistoryOptions ¶
type HistoryOptions struct { TimestampFormat string TimeSlot time.Duration Window time.Duration Interval time.Duration MaxRequests uint64 MaxRatio float64 }
HistoryOptions configures the behaviour of History
Click to show internal directories.
Click to hide internal directories.