middleware

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

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

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志

func LoadTls

func LoadTls() gin.HandlerFunc

LoadTls 开启https

func MiddlewareApiLog

func MiddlewareApiLog(c *gin.Context)

MiddlewareApiLog 记录框架出入参, 开启链路追踪

func NoMethodHandle

func NoMethodHandle() gin.HandlerFunc

NoMethodHandle 处理未知请求方式

func NotRouter

func NotRouter() gin.HandlerFunc

NotRouter 处理未知请求路由

Types

type Req

type Req struct {
	URL     string              `json:"url"`
	Method  string              `json:"method"`
	IP      string              `json:"ip"`
	Path    string              `json:"path"`
	Headers map[string][]string `json:"headers"`
	Query   interface{}         `json:"query"`
	Body    interface{}         `json:"body"`
}

Jump to

Keyboard shortcuts

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