Documentation
¶
Index ¶
- Constants
- func Cors() gin.HandlerFunc
- func GetClaims(ctx *gin.Context) (*utils.CustomClaims, error)
- func GetGlobalContext(ctx *gin.Context) (*contexts.GlobalContext, error)
- func GinRecovery(stack bool) gin.HandlerFunc
- func JWTAuth() gin.HandlerFunc
- func NeedRoleDBA() gin.HandlerFunc
- func WithGlobalContext(globalCtx *contexts.GlobalContext) gin.HandlerFunc
- func ZapLogger() gin.HandlerFunc
Constants ¶
View Source
const ( TokenKey = "X-Token" ClaimsKey = "claims" )
View Source
const GlobalContextKey = "global-contexts"
GlobalContextKey is the key in gin.Context for GlobalContext.
Variables ¶
This section is empty.
Functions ¶
func GetGlobalContext ¶
func GetGlobalContext(ctx *gin.Context) (*contexts.GlobalContext, error)
GetGlobalContext fetches the GlobalContext instance from middlewares.
func GinRecovery ¶
func GinRecovery(stack bool) gin.HandlerFunc
func WithGlobalContext ¶
func WithGlobalContext(globalCtx *contexts.GlobalContext) gin.HandlerFunc
WithGlobalContext injects the GlobalContext instance into gin.Context.
func ZapLogger ¶
func ZapLogger() gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.