feat: code cleanup
This commit is contained in:
1 parent
9f9f62f598
commit
ab445203aa
4 files changed
+7
-110
No files matched your search
+1
-4
@@ -9,14 +9,11 @@ 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 // 重置
|
||||
|
||||