ginx

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func InitCounter

func InitCounter(opt prometheus.CounterOpts)

func NewLogMdlHandlerFunc

func NewLogMdlHandlerFunc(l logx.Loggerx)

func Wrap

func Wrap(fn func(ctx *gin.Context) (Result, error)) gin.HandlerFunc

func WrapBody

func WrapBody[Req any](bizFn func(ctx *gin.Context, req Req) (Result, error)) gin.HandlerFunc

func WrapBodyAndClaims

func WrapBodyAndClaims[Req any, Claims jwt.Claims](bizFn func(ctx *gin.Context, req Req, uc Claims) (Result, error)) gin.HandlerFunc

WrapBodyAndClaims bizFn 就是你的业务逻辑

func WrapClaims

func WrapClaims[Claims any](
	bizFn func(ctx *gin.Context, uc Claims) (Result, error),
) gin.HandlerFunc

Types

type Result

type Result struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

Directories

Path Synopsis
middleware
jwtX2
Package jwtX2 提供基于 JWT 的认证中间件,支持多设备管理和会话控制。
Package jwtX2 提供基于 JWT 的认证中间件,支持多设备管理和会话控制。
jwtX2/mocks
Package jwtxmocks is a generated GoMock package.
Package jwtxmocks is a generated GoMock package.
jwtx/mocks
Package jwtxmocks is a generated GoMock package.
Package jwtxmocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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