// Package abstract ... // // Description : abstract ... // // Author : go_developer@163.com<白茶清欢> // // Date : 2024-06-20 11:33 package abstract import ( "context" "git.zhangdeman.cn/zhangdeman/rate_limit/define" ) // IRateLimit 流控实现接口约束 // // Author : go_developer@163.com<白茶清欢> // // Date : 11:33 2024/6/20 type IRateLimit interface { AllowN(ctx context.Context, limitCfg *define.LimitConfig, tokenCnt int) (bool, error) // 申请N个令牌, N >= 0 Reset(ctx context.Context, limitCfg *define.LimitConfig) error // 重置 }