feat(core): 下沉 CORS Scalar 与限流执行器
Verify / verify (push) Canceled after 0s

This commit is contained in:
zhangdeman committed 2026-11-28 02:28:13 -08:00
1 parent 624093773b
commit 568e516b1a
18 files changed
+912 -80

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
package ratelimit
import (
"context"
)
// Disabled 表示入口明确禁用流控时的无状态实现。
type Disabled struct{}
// AllowN 在关闭流控时始终放行。
// 入参:ctx 为调用上下文,cfg 为额度配置,count 为消耗令牌数。
// 返回:固定允许且无错误。
func (Disabled) AllowN(ctx context.Context, cfg *Config, count int) (bool, error) {
return true, nil
}
// Reset 在关闭流控时无需清理状态。
// 入参:ctx 为调用上下文,cfg 为主体配置。
// 返回:固定 nil。
func (Disabled) Reset(ctx context.Context, cfg *Config) error { return nil }
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.