Skip to content

Commit cac7f56

Browse files
committed
Adds Per day limit
1 parent 8eadf45 commit cac7f56

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rate.go

+8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ func PerHour(rate int) Limit {
7272
}
7373
}
7474

75+
func PerDay(rate int) Limit {
76+
return Limit{
77+
Rate: rate,
78+
Period: time.Hour * 24,
79+
Burst: rate,
80+
}
81+
}
82+
7583
// ------------------------------------------------------------------------------
7684

7785
// Limiter controls how frequently events are allowed to happen.

0 commit comments

Comments
 (0)