Structin erlcompute-sdk-go v1.11.0View source
type Policy struct {
MaxRate uint32
PenaltyBoxDuration time.Duration
}

Policy contains the rules for applying a RateLimiter.

Fields

RateWindow

RateWindow

RateWindow is the window of time to consider when checking the rate of events per second.

MaxRate

uint32

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.Duration

PenaltyBoxDuration 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.