middleware

package
v0.0.0-...-5d42812 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 12 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL