middleware

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIENT_IP = "client_ip"
	SERVER_IP = "server_ip"
)
View Source
const (
	GIN_CONTEXT_KEY = "GinContextKey"
)
View Source
const (
	REQUEST_ID = "X-Request-Id"
)
View Source
const (
	TAG_NAME = "middleware"
)

Variables

This section is empty.

Functions

func GetCliCtx

func GetCliCtx() *gin.Context

cli context

func GetClientIp

func GetClientIp(ctx *gin.Context) string

func GetRequestId

func GetRequestId(ctx *gin.Context) string

GetRequestId 获取RequestId,请求唯一标识

func GetServerIp

func GetServerIp(ctx *gin.Context) string

func GinContextFromContext

func GinContextFromContext(ctx context.Context) (*gin.Context, error)

func IpMiddleware

func IpMiddleware() gin.HandlerFunc

func RequestIdMiddleware

func RequestIdMiddleware() gin.HandlerFunc

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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