RateLimitLayer constructor
RateLimitLayer({
- int maxRequests = 20,
- Duration window = const Duration(minutes: 1),
- StorageAdapter? storage,
Creates a rate-limit layer, defaulting to MemoryStorage unless a
shared storage adapter is provided.
Implementation
RateLimitLayer({
this.maxRequests = 20,
this.window = const Duration(minutes: 1),
StorageAdapter? storage,
}) : storage = storage ?? MemoryStorage();