middleware

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRealIP added in v0.13.3

func GetRealIP(c *gin.Context, useCDN bool) (realIP string)

GetRealIP 如果开启了CDN之类的,获取真实IP需要从头部读取

Types

type Base

type Base struct {
}

func (Base) Cors

func (b Base) Cors() gin.HandlerFunc

Cors 开放所有接口的OPTIONS方法

func (Base) SetGPC

func (b Base) SetGPC(e *gin.Engine) gin.HandlerFunc

SetGPC 设置响应头

func (Base) SetRealIP added in v0.13.3

func (b Base) SetRealIP(useCDN bool) gin.HandlerFunc

SetRealIP 设置真实IP到gin上下文

Jump to

Keyboard shortcuts

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