middleware

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotFoundHandler

func NotFoundHandler() gin.HandlerFunc

NotFoundHandler router not found.

func TimeoutHandler

func TimeoutHandler(timeout time.Duration) func(c *gin.Context)

TimeoutHandler server timeout middleware wraps the request context with a timeout 中间件参考go-chi/chi库 https://github.com/go-chi/chi/blob/master/middleware/timeout.go

func WrapMonitor

func WrapMonitor() gin.HandlerFunc

WrapMonitor metrics 性能监控 gin处理器函数,包装 handler function,不侵入业务逻辑

Types

type LogWare

type LogWare struct{}

LogWare 日志中间件

func (*LogWare) Access

func (ware *LogWare) Access() gin.HandlerFunc

Access 记录访问日志

func (*LogWare) Recover

func (ware *LogWare) Recover() gin.HandlerFunc

Recover gin请求处理中遇到异常或panic捕获

Jump to

Keyboard shortcuts

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