jaguar_throttle library

Provides Throttler

Classes

Rate
Rate structure. Holds count per interval
ThrottleData
Contains count information for a single throttle identifier/key
Throttler
Interceptor to rate-limit routes
ThrottleState
Contains the throttle state information

Properties

defaultThrottleCache Cache
final

Functions

perDay(int count) Rate
Creates Rate with count per day
perHour(int count) Rate
Creates Rate with count per hour
perMin(int count) Rate
Creates Rate with count per minute
perSec(int count) Rate
Creates Rate with count per second
throttle(String id, Rate quota, { Cache store }) → Future<ThrottleState>
Throttles for given id with quota
throttleIdByIp(Context ctx) → String
ThrottleIdMaker to throttle requests by remote IP

Typedefs

ThrottleIdMaker(Context ctx) → FutureOr<String>
Identifies a HTTP request given the Context object [...]