Add errorMessage
This commit is contained in:
parent
0f6011d693
commit
7ce51b1581
1 changed files with 9 additions and 1 deletions
|
@ -18,7 +18,15 @@ abstract class RateLimiter<User> {
|
||||||
/// more than [maxPointsPerWindow].
|
/// more than [maxPointsPerWindow].
|
||||||
final Duration windowDuration;
|
final Duration windowDuration;
|
||||||
|
|
||||||
RateLimiter(this.maxPointsPerWindow, this.windowDuration);
|
/// The error message to send to a [User] who has exceeded the
|
||||||
|
/// rate limit during the current window.
|
||||||
|
///
|
||||||
|
/// This only applies to the default implementation of
|
||||||
|
/// [denyRequest].
|
||||||
|
final String errorMessage;
|
||||||
|
|
||||||
|
RateLimiter(this.maxPointsPerWindow, this.windowDuration,
|
||||||
|
{this.errorMessage});
|
||||||
|
|
||||||
/// Computes the current window in which the user is acting.
|
/// Computes the current window in which the user is acting.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue