Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2023 Changes in this version + const LanguageEN + const LanguageZhCN + const LanguageZhTW + const SexFemale + const SexMale + const SexUnknown + func Auth(accessToken, openId string, httpClient *http.Client) (valid bool, err error) + func AuthCodeURL(appId, redirectURI, scope, state string) string + type Endpoint struct + AppId string + AppSecret string + func NewEndpoint(AppId, AppSecret string) *Endpoint + func (p *Endpoint) ExchangeTokenURL(code string) string + func (p *Endpoint) RefreshTokenURL(refreshToken string) string + func (p *Endpoint) SessionCodeUrl(code string) string + type Session struct + OpenId string + SessionKey string + UnionId string + func GetSession(Endpoint *Endpoint, code string) (session *Session, err error) + func GetSessionWithClient(Endpoint *Endpoint, code string, httpClient *http.Client) (session *Session, err error) + type SessionInfo struct + AvatarUrl string + City string + Country string + Gender int + Language string + Nickname string + OpenId string + Province string + UnionId string + func GetSessionInfo(EncryptedData, sessionKey, iv string) (info *SessionInfo, err error) + type UserInfo struct + City string + Country string + HeadImageURL string + Nickname string + OpenId string + Privilege []string + Province string + Sex int + UnionId string + func GetUserInfo(accessToken, openId, lang string, httpClient *http.Client) (info *UserInfo, err error)