摘要: 固定窗口 package main import ( "fmt" "sync" "sync/atomic" "time" ) // 定义限流结构体 type RateLimiter struct { interval time.Duration // 时间窗口 tokens int32 // 令牌总 阅读全文
posted @ 2024-09-06 09:42 朝阳1 阅读(79) 评论(0) 推荐(0)