RateLimitStore class

In-memory store for rate limit data.

For production use with multiple instances, consider using a distributed store like Redis.

Constructors

RateLimitStore({Duration cleanupInterval = const Duration(minutes: 5)})
Creates a rate limit store with automatic cleanup.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears all rate limit data.
dispose() → void
Disposes the store and stops the cleanup timer.
increment(String key, RateLimitOptions options) RateLimitInfo
Increments the request count for the given key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek(String key, RateLimitOptions options) RateLimitInfo?
Gets the current rate limit info for the given key without incrementing.
reset(String key) → void
Resets the rate limit for the given key.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited