RateLimitLayer constructor

RateLimitLayer({
  1. int maxRequests = 20,
  2. Duration window = const Duration(minutes: 1),
  3. 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();