middleware

package
v0.0.0-...-ca31ff8 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MiddlewareValidate = validator.New()

中间件验证器

Functions

func AuthToken

func AuthToken(c *fiber.Ctx) error

用户授权中间件 https://docs.gofiber.io/guide/routing#middleware https://github.com/golang-jwt/jwt/v4 登录成功时生成令牌 token, err := common.GenerateToken("username") 用户授权时解析令牌 claims, err := common.ParseToken("token")

func CORS

func CORS(app *fiber.App)

跨域中间件 https://docs.gofiber.io/api/middleware/cors

func Limiter

func Limiter(app *fiber.App)

限制中间件 https://docs.gofiber.io/api/middleware/limiter

func Logger

func Logger(app *fiber.App)

日志中间件 https://docs.gofiber.io/api/middleware/logger

Types

type Headers

type Headers struct {
	Authorization string `reqHeader:"authorization"`
}

请求头结构体

Jump to

Keyboard shortcuts

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