oauth

package
v0.0.0-...-cbd8eca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQQOpenId

func GetQQOpenId(token QQAccessToken) (openid string, err error)

获取OpenId

Types

type GiteeAccessToken

type GiteeAccessToken struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	CreatedAt    int    `json:"created_at"`
}

gitee accesstoken 数据

func GetGiteeAccessToken

func GetGiteeAccessToken(code string) (token GiteeAccessToken, err error)

获取accessToken

type GiteeUser

type GiteeUser struct {
	Id        int       `json:"id"`                                  //用户id
	MemberId  int       `json:"member_id"`                           //绑定的用户id
	UpdatedAt time.Time `json:"updated_at"`                          //用户资料更新时间
	AvatarURL string    `json:"avatar_url" orm:"column(avatar_url)"` //用户头像链接
	Email     string    `json:"email" orm:"size(50)"`                //电子邮箱
	Login     string    `json:"login" orm:"size(50)"`                //用户名
	Name      string    `json:"name" orm:"size(50)"`                 //昵称
	HtmlURL   string    `json:"html_url" orm:"column(html_url)"`     //gitee主页
}

gitee 用户数据 用户使用gitee登录的时候,直接根据gitee的id获取数据

func GetGiteeUserInfo

func GetGiteeUserInfo(accessToken string) (info GiteeUser, err error)

获取用户信息

type GithubAccessToken

type GithubAccessToken struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	Scope       string `json:"scope"`
}

GitHub accesstoken 数据

func GetGithubAccessToken

func GetGithubAccessToken(code string) (token GithubAccessToken, err error)

获取accessToken

type GithubUser

type GithubUser struct {
	Id        int       `json:"id"`                                  //用户id
	MemberId  int       `json:"member_id"`                           //绑定的用户id
	UpdatedAt time.Time `json:"updated_at"`                          //用户资料更新时间
	AvatarURL string    `json:"avatar_url" orm:"column(avatar_url)"` //用户头像链接
	Email     string    `json:"email" orm:"size(50)"`                //电子邮箱
	Login     string    `json:"login" orm:"size(50)"`                //用户名
	Name      string    `json:"name" orm:"size(50)"`                 //昵称
	HtmlURL   string    `json:"html_url" orm:"column(html_url)"`     //github主页
}

GitHub 用户数据 用户使用GitHub登录的时候,直接根据GitHub的id获取数据

func GetGithubUserInfo

func GetGithubUserInfo(accessToken string) (info GithubUser, err error)

获取用户信息

type QQAccessToken

type QQAccessToken struct {
	AccessToken string `json:"access_token"`
}

qq accesstoken 数据

func GetQQAccessToken

func GetQQAccessToken(code string) (token QQAccessToken, err error)

获取accessToken

type QQUser

type QQUser struct {
	Ret       int    `json:"ret"`
	Msg       string `json:"msg"`
	AvatarURL string `json:"figureurl_qq_2"` //用户头像链接
	Name      string `json:"nickname"`       //昵称
	Gender    string `json:"gender"`         //性别
}

qq 用户数据 用户使用qq登录的时候,直接根据qq的id获取数据

func GetQQUserInfo

func GetQQUserInfo(accessToken, openid string) (info QQUser, err error)

获取用户信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL