Documentation ¶
Index ¶
- func Cors() gin.HandlerFunc
- func GetJwtErrFromCtx(ctx *gin.Context, req JwtReq) error
- func GetJwtObj() *jwtApi.JwtCfg
- func GetMcFromCtx(ctx *gin.Context, req JwtReq) (mc *jwtApi.MyClaims, err error)
- func GetTokenObjFromCtx(ctx *gin.Context, req JwtReq, obj any) error
- func InitJwtObj(obj *jwtApi.JwtCfg)
- func JWTAuthMiddleware(req JwtReq) gin.HandlerFunc
- type CtxKey
- type JwtReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶ added in v1.0.15
func Cors() gin.HandlerFunc
func GetJwtErrFromCtx ¶ added in v1.0.14
从ctx取得JwtCtxErrKey
func GetMcFromCtx ¶
GetMcFromCtx 从ctx取得 mc
func GetTokenObjFromCtx ¶ added in v1.0.8
GetTokenObjFromCtx form ctx 取得 mc 并且将token JsonUnmarshal 到obj中,要求obj为对象地址
func InitJwtObj ¶ added in v1.0.12
func JWTAuthMiddleware ¶
func JWTAuthMiddleware(req JwtReq) gin.HandlerFunc
JWTAuthMiddleware 基于JWT认证中间件
Types ¶
Click to show internal directories.
Click to hide internal directories.