Skip to content

Commit

Permalink
Adds Per day limit
Browse files Browse the repository at this point in the history
  • Loading branch information
irania9O committed Jun 9, 2024
1 parent 8eadf45 commit cac7f56
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ func PerHour(rate int) Limit {
}
}

func PerDay(rate int) Limit {
return Limit{
Rate: rate,
Period: time.Hour * 24,
Burst: rate,
}
}

// ------------------------------------------------------------------------------

// Limiter controls how frequently events are allowed to happen.
Expand Down

0 comments on commit cac7f56

Please sign in to comment.