Documentation ¶
Index ¶
- Constants
- Variables
- func AdminKeyRequired(ctx *gin.Context)
- func CheckAdminKey(ctx *gin.Context)
- func CheckApiKey(ctx *gin.Context)
- func GetCacheDuration(route string) time.Duration
- func Init()
- func JWTInitParamas() *jwt.GinJWTMiddleware
- 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 AdminKeyRequired ¶ added in v0.69.0
func CheckAdminKey ¶ added in v0.69.0
func CheckApiKey ¶ added in v0.69.0
func GetCacheDuration ¶ added in v0.60.0
func JWTInitParamas ¶
func JWTInitParamas() *jwt.GinJWTMiddleware
func OptionalJWTMiddleware ¶
用在一些可选登录接口上.
如果登录了, 则会在 ctx 中设置 "logged" 为 true, 并设置 "claims" 为 jwt.MapClaims.
func ValidateParamObjectID ¶
func ValidatePictureID ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.