Crate salvo_rate_limiter

Crate salvo_rate_limiter 

Source
Expand description

Rate limiter middleware for Salvo.

Rate Limiter middleware is used to limiting the amount of requests to the server from a particular IP or id within a time period.

RateIssuer is used to issue a key to request, your can define your custom RateIssuer. If you want just identify user by IP address, you can use RemoteIpIssuer.

QuotaGetter is used to get quota for every key.

RateGuard is strategy to verify is the request exceeded quota.

Read more: https://salvo.rs

Structs§

BasicQuota
A basic quota.
CelledQuota
A common used quota has cells field.
FixedGuardfixed-guard
Fixed window implement.
MokaStoremoka-store
A simple in-memory store for rate limiter.
RateLimiter
RateLimiter is the main struct to used limit user request.
RemoteIpIssuer
Identify user by IP address.
SlidingGuardsliding-guard
Sliding window implement.

Traits§

QuotaGetter
Used to get quota and you can config users’ quota config in database.
RateGuard
RateGuard is strategy to verify is the request exceeded quota
RateIssuer
Issuer is used to identify every request.
RateStore
RateStore is used to store rate limit data.