RateLimiter class
RateLimiter class for rate limiting requests
Constructors
- RateLimiter({required String storagePath, required int maxRequests, required Duration resetDuration, required String encryptionPassword, required IPBlocker ipBlocker, required CountryBlocker countryBlocker, required bool shouldDisplayCaptcha})
- Constructor
Properties
- countryBlocker → CountryBlocker
-
Country Blocker instance
final
- encryptionPassword → String
-
Encryption Key for IPs
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ipBlocker → IPBlocker
-
IP Blocker instance
final
- maxRequests → int
-
Max requests
final
- resetDuration → Duration
-
Reset duration
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldDisplayCaptcha → bool
-
Specifies if the captcha should be displayed when the rate limit is exceeded
final
- storagePath → String
-
File for IPs
final
Methods
-
isRateLimited(
String clientIp) → Future< bool> - Check if IP is rate limited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → Future< void> - Refreshes the rate limits, IP and Country block lists
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited