xmw

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MulanPSL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthKey    = "Authorization" // 请求头部关键字
	SessionKey = "session_key"   //
)

============================================================ * * 功能:API鉴权 * 类型:中间件 * 举例: "/land/login","/land/logout", "/ping","/res/" * ============================================================

Variables

This section is empty.

Functions

func ApiAuthMiddleware

func ApiAuthMiddleware(allowUrls ...string) gin.HandlerFunc

func CorsDomainMiddleware

func CorsDomainMiddleware() gin.HandlerFunc

====================================================================== * * 功能:解决跨域请求(CorsDomainMiddleware) * 类型:中间件 * 描述:上线需要去掉该中间件 * ======================================================================

func RecoveryMiddleware

func RecoveryMiddleware() gin.HandlerFunc

====================================================================== * * 功能:捕获所有panic,并且返回错误信息 (RecoveryMiddleware) * 类型:中间件 * 描述:遇到异常报错后 还会接着往下执行 不会影响整个系统运行 * ======================================================================

func RequestLogMiddleware

func RequestLogMiddleware() gin.HandlerFunc

====================================================================== * * 功能:请求日志记录中间件 (RequestLogMiddleware) * 类型:中间件 * 描述:记录日志 * ======================================================================

func TranslationMiddleware

func TranslationMiddleware() gin.HandlerFunc

================================================================================================ * * 功能:初始 化验证器 和 翻译器 (TranslationMiddleware) * 类型:中间件 * 描述:https://github.com/go-playground/validator/blob/master/_examples/translations/main.go * ================================================================================================

Types

This section is empty.

Jump to

Keyboard shortcuts

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