Versions in this module Expand all Collapse all v1 v1.0.2 Mar 14, 2022 v1.0.1 May 23, 2020 v1.0.0 Apr 20, 2020 Changes in this version + func ParseAccessTokenForQq(source string) (string, string, int) + func ParseOpenIdForQq(source string) string + func ParseUnionIdForQq(source string) string + type IOauth interface + GetAccessToken func(code string) (*OauthToken, error) + GetAuthorizeUrl func(args ...string) string + GetUserInfo func(accessToken, openId string) (*OauthUser, error) + RefreshAccessToken func(refreshToken string) (*OauthToken, error) + SetUri func(uriType OauthUriType, uri string) + func NewQq(clientId, clientSecret, callbackUri string) IOauth + func NewWeChat(clientId, clientSecret, callbackUri string) IOauth + type Oauth struct + AccessTokenUri string + AuthorizeCodeUri string + CallbackUri string + ClientId string + ClientSecret string + OpenIdUri string + RefreshTokenUri string + UserInfoUri string + type OauthQq struct + func (s *OauthQq) GetAccessToken(code string) (*OauthToken, error) + func (s *OauthQq) GetAuthorizeUrl(args ...string) string + func (s *OauthQq) GetOpenId(accessToken string) (string, error) + func (s *OauthQq) GetUnionId(accessToken string) (string, error) + func (s *OauthQq) GetUserInfo(accessToken, openId string) (*OauthUser, error) + func (s *OauthQq) RefreshAccessToken(refreshToken string) (*OauthToken, error) + func (s *OauthQq) SetUri(uriType OauthUriType, uri string) + type OauthState struct + func NewOauthState(encryptKey string, minutes int) *OauthState + func (s *OauthState) GetState() string + func (s *OauthState) IsValid(rawState string) bool + type OauthToken struct + AccessToken string + ExpiresIn int + OpenId string + RefreshToken string + Scope string + UnionId string + type OauthUriType int + const AccessTokenUri + const AuthorizeCodeUri + const OpenIdUri + const RefreshTokenUri + const UserInfoUri + type OauthUser struct + Avatar string + City string + Nickname string + Province string + Sex string + Token *OauthToken + Year string + type OauthWeChat struct + func (s *OauthWeChat) GetAccessToken(code string) (*OauthToken, error) + func (s *OauthWeChat) GetAuthorizeUrl(args ...string) string + func (s *OauthWeChat) GetUserInfo(accessToken, openId string) (*OauthUser, error) + func (s *OauthWeChat) RefreshAccessToken(refreshToken string) (*OauthToken, error) + func (s *OauthWeChat) SetUri(uriType OauthUriType, uri string) + type QqUserInfoResponse struct + City string + FigureUrl string + FigureUrl1 string + FigureUrl2 string + FigureUrlQq1 string + FigureUrlQq2 string + Gender string + IsYellowVip string + IsYellowYearVip string + Level string + Msg string + Nickname string + Province string + Ret int + Vip string + Year string + YellowVipLevel string + type WeChatAccessTokenResponse struct + AccessToken string + ErrCode string + ErrMsg string + ExpiresIn int + OpenId string + RefreshToken string + Scope string + UnionId string + type WeChatUserInfoResponse struct + City string + Country string + ErrCode string + ErrMsg string + HeadImgUrl string + Nickname string + OpenId string + Privileges []string + Province string + Sex int + UnionId string