Add files via upload

This commit is contained in:
公明 authored and GitHub committed 2026-04-28 11:37:52 +08:00
1 parent 3b3d094dc4
commit b53cae3a02
26 files changed
+374 -374

No files matched your search

+4 -4
View File
@@ -16,10 +16,10 @@ type rateLimitEntry struct {
// RateLimiter 基于 IP 的滑动窗口速率限制器
type RateLimiter struct {
mu sync.Mutex
entries map[string]*rateLimitEntry
limit int // 窗口内允许的最大请求数
window time.Duration // 窗口时长
mu sync.Mutex
entries map[string]*rateLimitEntry
limit int // 窗口内允许的最大请求数
window time.Duration // 窗口时长
}
// NewRateLimiter 创建速率限制器