redis流控测试
This commit is contained in:
@ -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