namespace WIDESEAWCS_RedisService.RateLimiting
{
public interface IRateLimitingService
{
///
/// 固定窗口限流
///
bool IsAllowed(string key, int maxRequests, TimeSpan window);
///
/// 滑动窗口限流
///
bool IsAllowedSliding(string key, int maxRequests, TimeSpan window);
///
/// 令牌桶限流
///
bool TryAcquireToken(string key, int maxTokens, int refillRate, TimeSpan refillInterval);
///
/// 获取剩余请求数
///
long GetRemainingRequests(string key, int maxRequests, TimeSpan window);
}
}