Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func RateLimitOnConcurrency ¶
func RateLimitOnConcurrency(maxConcurrency int64, logOnly bool) gin.HandlerFunc
RateLimitOnConcurrency 限制最大并发数 估算最大并发数公式:
单机峰值OPS * 接口平均延时,
例如:
服务峰值ops = 8000个请求每秒, 接口平均延时为 25ms 那么, 最大并发数 = 8000 * 0.025 = 200
Types ¶
type RateLimitConcurrency ¶
type RateLimitConcurrency struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.