middleware

package
v0.0.0-...-e06d7b7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	Path     string        `json:"path"`     // 请求路径
	Method   string        `json:"method"`   // 请求方法
	ReqBody  string        `json:"reqBody"`  // 请求体内容
	Status   int           `json:"status"`   // 响应状态码
	RespBody string        `json:"respBody"` // 响应体内容
	Duration time.Duration `json:"duration"` // 请求处理耗时
}

type CasbinMiddleware

type CasbinMiddleware struct {
	// contains filtered or unexported fields
}

func NewCasbinMiddleware

func NewCasbinMiddleware(enforcer *casbin.Enforcer) *CasbinMiddleware

func (*CasbinMiddleware) CheckCasbin

func (cm *CasbinMiddleware) CheckCasbin() gin.HandlerFunc

CheckCasbin 创建一个 Casbin 中间件

type JWTMiddleware

type JWTMiddleware struct {
	ijwt.Handler
}

func NewJWTMiddleware

func NewJWTMiddleware(hdl ijwt.Handler) *JWTMiddleware

func (*JWTMiddleware) CheckLogin

func (m *JWTMiddleware) CheckLogin() gin.HandlerFunc

CheckLogin 校验JWT

type LogMiddleware

type LogMiddleware struct {
	// contains filtered or unexported fields
}

func NewLogMiddleware

func NewLogMiddleware(l *zap.Logger) *LogMiddleware

func (*LogMiddleware) Log

func (lm *LogMiddleware) Log() gin.HandlerFunc

Log 日志中间件

Jump to

Keyboard shortcuts

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