Documentation
¶
Overview ¶
Package ratelimit is used to rate-limit requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attempt ¶
func Attempt(ctx context.Context, user string, now time.Time, max int, interval time.Duration) error
Attempt determines if a new request by the client identified by user is allowed. An error is returned if max or more successful attempts were already made in interval. Errors can also be returned for datastore failures.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.