redis流控测试

This commit is contained in:
zhangdeman committed 2024-06-20 18:43:27 +08:00
1 parent 54a77d170a
commit 545523e324
5 files changed
+21 -18

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ type IRateLimit interface {
// Month(ctx context.Context, key string, total, rate int) (bool, error) // 每月访问次数限制
// Year(ctx context.Context, key string, total, rate int) (bool, error) // 每年访问次数限制
// Custom(ctx context.Context, timeInfo int64, key string, total, rate int) (bool, error) // 自定义指定时间内的访问次数, timeInfo 单位 : s
SetRedisClient(client *redis.ClusterClient) // 设置redis客户端
SetRedisClient(client *redis.Client) // 设置redis客户端
AllowN(ctx context.Context, limitCfg *define.LimitConfig, tokenCnt int) (bool, error) // 申请N个令牌, N >= 0
Reset(ctx context.Context, limitCfg *define.LimitConfig) error // 重置
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.