Documentation ¶
Index ¶
- Constants
- Variables
- func CheckKey(ctx *gin.Context)
- func GetCacheDuration(route string) time.Duration
- func Init()
- func JWTInitParamas() *jwt.GinJWTMiddleware
- func KeyRequired(ctx *gin.Context)
- func OptionalJWTMiddleware(ctx *gin.Context)
- func ValidateParamObjectID(ctx *gin.Context)
- func ValidatePictureID(ctx *gin.Context)
- type Login
- type User
Constants ¶
View Source
const (
IdentityKey = "id"
)
Variables ¶
View Source
var CacheStore persist.CacheStore
View Source
var JWTAuthMiddleware *jwt.GinJWTMiddleware
Functions ¶
func GetCacheDuration ¶ added in v0.60.0
func JWTInitParamas ¶
func JWTInitParamas() *jwt.GinJWTMiddleware
func KeyRequired ¶
func OptionalJWTMiddleware ¶
用在一些可选登录接口上.
如果登录了, 则会在 ctx 中设置 "logged" 为 true, 并设置 "claims" 为 jwt.MapClaims.
func ValidateParamObjectID ¶
func ValidatePictureID ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.