middlewares

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECOVERY string = "recovery"
	CORS     string = "cors"
)

外部可以用

Variables

View Source
var Middlewares = map[string]gin.HandlerFunc{
	"recovery": Recovery(),
	"cors":     Cors(),
}

Functions

func Cors

func Cors() gin.HandlerFunc

func Recovery

func Recovery() gin.HandlerFunc

Recovery 来记录 Panic 和 call stack

func TimeoutMiddleware

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

为每个请求添加上下文 超时控制中间件

Types

This section is empty.

Jump to

Keyboard shortcuts

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