middleware

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationCreate = "CREATE"
	OperationUpdate = "UPDATE"
	OperationDelete = "DELETE"
	OperationQuery  = "VIEW"
	Unknown         = "UNKNOWN"
)

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 AuditLogMiddleware

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

func NewAuditLogMiddleware

func NewAuditLogMiddleware(auditSvc service.AuditService, l *zap.Logger) *AuditLogMiddleware

func (*AuditLogMiddleware) AuditLog

func (m *AuditLogMiddleware) AuditLog() gin.HandlerFunc

type AuthMiddleware

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

func NewAuthMiddleware

func NewAuthMiddleware(roleService service.RoleService) *AuthMiddleware

func (*AuthMiddleware) CheckAuth

func (am *AuthMiddleware) CheckAuth() gin.HandlerFunc

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