RateLimitConfig class
Configuration for rate limiting events with security validations
Constructors
- RateLimitConfig({int? interval, bool? trailing, int? bucketSize, int? emptyBucketDelay, bool? rejectWhenBucketFull})
-
const
-
RateLimitConfig.fromMap(Map<
String, dynamic> map) -
Create from Map (for deserialization) with security validation
factory
- RateLimitConfig.secure({int? interval, bool? trailing, int? bucketSize, int? emptyBucketDelay, bool? rejectWhenBucketFull})
-
Create a RateLimitConfig with validated values for security
factory
Properties
- bucketSize → int?
-
The number of executions allowed before rate-limiting kicks in
final
- emptyBucketDelay → int?
-
Time in milliseconds of inactivity after which the execution count is reset
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → int?
-
The interval in milliseconds between executions when rate limit is active
final
- rejectWhenBucketFull → bool?
-
If true, drops all calls when rate-limited until bucket is reset
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trailing → bool?
-
Whether to save the last call and execute it after the interval
final
Methods
-
copyWith(
{int? interval, bool? trailing, int? bucketSize, int? emptyBucketDelay, bool? rejectWhenBucketFull}) → RateLimitConfig - Create a copy with optional parameter overrides (with security validation)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Convert to Map for serialization
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- maxBucketSize → const int
- maxEmptyBucketDelay → const int
- maxInterval → const int
- minBucketSize → const int
- minEmptyBucketDelay → const int
- minInterval → const int