middleware

package
v0.0.0-...-10cedd8 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlwaysAllowPath sets.String

Functions

func CasbinHandler

func CasbinHandler() gin.HandlerFunc

CasbinHandler 拦截器

func Cores

func Cores() gin.HandlerFunc

Cores 处理跨域请求,支持options访问

func InstallMiddlewares

func InstallMiddlewares(ginEngine *gin.RouterGroup)

func JWTAuth

func JWTAuth() gin.HandlerFunc

JWTAuth jwt认证函数

func Limiter

func Limiter() gin.HandlerFunc

func Logger

func Logger() gin.HandlerFunc

Logger 接收gin框架默认的日志

func OperationRecord

func OperationRecord() gin.HandlerFunc

func Recovery

func Recovery(stack bool) gin.HandlerFunc

Recovery 使用自定义日志库替换原有recover中间件

func ResponseError

func ResponseError(c *gin.Context, err error)

func ResponseSuccess

func ResponseSuccess(c *gin.Context, data interface{})

func TranslationMiddleware

func TranslationMiddleware() gin.HandlerFunc

设置Translation

Types

type Response

type Response struct {
	Code    ResponseCode `json:"code"`
	Msg     string       `json:"msg"`
	RealErr string       `json:"real_err"`
	Data    interface{}  `json:"data"`
}

type ResponseCode

type ResponseCode int

Jump to

Keyboard shortcuts

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