middleware

package
v0.0.0-...-b32e05d Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

Cors 直接放行所有跨域请求并放行所有 OPTIONS 方法

func GinLogger

func GinLogger() gin.HandlerFunc

接收gin框架默认的日志

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志

func JwtToken

func JwtToken(tk *jwtx.JwtInstance) gin.HandlerFunc

JwtToken jwt中间件

func Limit

func Limit(rdb *redis.Client) gin.HandlerFunc

限频

func LoadTls

func LoadTls() gin.HandlerFunc

func LoginToken

func LoginToken() gin.HandlerFunc

登录token 登录时,token = md5(uid,ts),从redis中获取token对应的用户信息

func SignToken

func SignToken() gin.HandlerFunc

未登录token 未登录时,token = md5(tm,ts)

func Trace

func Trace() gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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