Open
Description
There are three ways to initialize a "Limit", which are "PerSecond(rate int)", "PerMinute(rate int)", "PerHour(rate int)". But the Limit generated by these three functions,the values of its "Rate" and "Burst" fields are equal。So I'd like to create a few more functions that initialize the LIMIT, which can specify the "rate" field and the "burst" field separately。
func PerHourWithCapacity(rate int, capacity int) Limit {
return Limit{
Rate: rate,
Period: time.Hour,
Burst: capacity,
}
}
Metadata
Metadata
Assignees
Labels
No labels