feat: 增加接口流量配置中间件

This commit is contained in:
2026-01-04 15:28:11 +08:00
parent 3788d2b4b6
commit ded502746c
13 changed files with 215 additions and 79 deletions

View File

@@ -14,3 +14,9 @@ type IsBlackIP func(ctx *gin.Context, clientIP string) bool
// IsWhiteIP 是否白名单IP
type IsWhiteIP func(ctx *gin.Context, clientIP string) bool
type RateLimitConfig struct {
Use int `json:"use" dc:"单次访问使用令牌数"`
Total int `json:"total" dc:"单位时间内允许访问的总次数"`
TimeInterval int64 `json:"time_interval" dc:"单位时间间隔"`
}