Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func ExceptionMiddleware ¶
func ExceptionMiddleware() gin.HandlerFunc
func GetUserIdByToken ¶
func TokenMiddleware ¶
func TokenMiddleware(validateToken bool) gin.HandlerFunc
Types ¶
type RequestHelper ¶
type RequestHelper struct { }
type UserSessionLoginInfo ¶
type UserSessionLoginInfo struct { TenantID int `json:"tenantId"` Token string `json:"token"` //LoginType string `json:"loginType"` UserID int `json:"userId"` LoginName string `json:"loginName"` UserName string `json:"userName"` }
func GetUserToken ¶
func GetUserToken(c *gin.Context) *UserSessionLoginInfo
type UserTokenCache ¶
type UserTokenCache struct {
// contains filtered or unexported fields
}
func NewUserTokenCache ¶
func NewUserTokenCache() *UserTokenCache
func (*UserTokenCache) AddTokenInfo ¶
func (u *UserTokenCache) AddTokenInfo(token string, tokenInfo UserSessionLoginInfo) bool
func (*UserTokenCache) GetTokenInfo ¶
func (u *UserTokenCache) GetTokenInfo(token string) *UserSessionLoginInfo
func (*UserTokenCache) Refresh ¶
func (u *UserTokenCache) Refresh(token string) bool
func (*UserTokenCache) RemoveTokenInfo ¶
func (u *UserTokenCache) RemoveTokenInfo(token string) bool
Click to show internal directories.
Click to hide internal directories.