Documentation
¶
Index ¶
- Variables
- func GetAccessToken(appId string, secret string, cache *cache.RedisCache) (string, error)
- func GetAccessTokenByCache(appId string, cache *cache.RedisCache) (string, string, error)
- func GetAccessTokenByCode(appId string, secret string, code string, cache *cache.RedisCache) (string, string, error)
- func Verify(token string, method string, urls []string) gin.HandlerFunc
- type AccessToken
- type TokenVerifyReq
- type UserInfo
- type WebAccessToken
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AccessTokenKey = "access_token::" RefreshTokenKey = "refresh_token::" AccessTokenTTL = 7000 RefreshTokenTTL = 7000 )
View Source
var ( WebAccessTokenKey = "web_access_token::" WebAccessTokenTTL = 7000 WebRefreshTokenKey = "web_refresh_token::" WebRefreshTokenTTL = 3600 * 24 * 29 )
Functions ¶
func GetAccessToken ¶
func GetAccessTokenByCache ¶
func GetAccessTokenByCode ¶
Types ¶
type AccessToken ¶
type TokenVerifyReq ¶
type UserInfo ¶
type UserInfo struct {
Openid string `json:"openid"`
Nickname string `json:"nickname"`
Sex int `json:"sex"`
Province string `json:"province"`
City string `json:"city"`
Country string `json:"country"`
Headimgurl string `json:"headimgurl"`
Privilege []string `json:"privilege"`
Unionid string `json:"unionid"`
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
}
type WebAccessToken ¶
Click to show internal directories.
Click to hide internal directories.