Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func CustomRecovery ¶
func CustomRecovery() gin.HandlerFunc
func JWTAuth ¶
func JWTAuth(GuardName string) gin.HandlerFunc
func LimitHandler ¶
func LimitHandler(maxConn, rate float64) gin.HandlerFunc
LimitHandler 接口IP限流,黑名单&白名单的实例
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
type TokenBucket ¶
type TokenBucket struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.