Policy
type Policy struct {
MaxRate uint32
PenaltyBoxDuration time.Duration}Policy contains the rules for applying a RateLimiter.
Fields
RateWindow
RateWindowRateWindow is the window of time to consider when checking the rate of events per second.
MaxRate is the maximum number of events per second to allow over the rate window. The minimum value is 10 and the maximum is 10000.
PenaltyBoxDuration
time.DurationPenaltyBoxDuration is the duration to penalize entries that exceed the maximum rate. As with PenaltyBox.Add, the minimum value is 1 minute and the maximum is 60 minutes.