auth

package
v1.1.45 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailLoginParams added in v1.1.27

type EmailLoginParams struct {
	Code  string `json:"code"`
	Email string `json:"email"`
}

EmailLoginParams 邮箱登录参数

type GiteeUser

type GiteeUser struct {
	AvatarURL         string `json:"avatar_url"`
	Bio               string `json:"bio"`
	Blog              string `json:"blog"`
	CreatedAt         string `json:"created_at"`
	Email             string `json:"email"`
	EventsURL         string `json:"events_url"`
	Followers         uint32 `json:"followers"`
	FollowersURL      string `json:"followers_url"`
	Following         uint32 `json:"following"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	HTMLURL           string `json:"html_url"`
	ID                uint32 `json:"id"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	OrganizationsURL  string `json:"organizations_url"`
	PublicGists       uint32 `json:"public_gists"`
	PublicRepos       uint32 `json:"public_repos"`
	ReceivedEventsURL string `json:"received_events_url"`
	Remark            string `json:"remark"`
	ReposURL          string `json:"repos_url"`
	Stared            uint32 `json:"stared"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	Type              string `json:"type"`
	UpdatedAt         string `json:"updated_at"`
	URL               string `json:"url"`
	Watched           uint32 `json:"watched"`
	Weibo             string `json:"weibo"`
}

GiteeUser Gitee用户

func (*GiteeUser) GetAPP

func (g *GiteeUser) GetAPP() vobj.OAuthAPP

GetAPP 获取OAuth应用

func (*GiteeUser) GetAvatar

func (g *GiteeUser) GetAvatar() string

GetAvatar 获取头像

func (*GiteeUser) GetEmail

func (g *GiteeUser) GetEmail() string

GetEmail 获取邮箱

func (*GiteeUser) GetNickname

func (g *GiteeUser) GetNickname() string

GetNickname 获取昵称

func (*GiteeUser) GetOAuthID

func (g *GiteeUser) GetOAuthID() uint32

GetOAuthID 获取OAuth ID

func (*GiteeUser) GetRemark

func (g *GiteeUser) GetRemark() string

GetRemark 获取备注

func (*GiteeUser) GetUsername

func (g *GiteeUser) GetUsername() string

GetUsername 获取用户名

func (*GiteeUser) String

func (g *GiteeUser) String() string

String 将Gitee用户转换为字符串

type GithubUser

type GithubUser struct {
	AvatarURL         string `json:"avatar_url"`
	Bio               string `json:"bio"`
	Blog              string `json:"blog"`
	Company           string `json:"company"`
	CreatedAt         string `json:"created_at"`
	Email             string `json:"email"`
	EventsURL         string `json:"events_url"`
	Followers         uint32 `json:"followers"`
	FollowersURL      string `json:"followers_url"`
	Following         uint32 `json:"following"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	GravatarID        string `json:"gravatar_id"`
	Hireable          any    `json:"hireable"`
	HTMLURL           string `json:"html_url"`
	ID                uint32 `json:"id"`
	Location          string `json:"location"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	NodeID            string `json:"node_id"`
	NotificationEmail any    `json:"notification_email"`
	OrganizationsURL  string `json:"organizations_url"`
	PublicGists       uint32 `json:"public_gists"`
	PublicRepos       uint32 `json:"public_repos"`
	ReceivedEventsURL string `json:"received_events_url"`
	ReposURL          string `json:"repos_url"`
	SiteAdmin         bool   `json:"site_admin"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	TwitterUsername   any    `json:"twitter_username"`
	Type              string `json:"type"`
	UpdatedAt         string `json:"updated_at"`
	URL               string `json:"url"`
}

GithubUser Github用户

func (*GithubUser) GetAPP

func (g *GithubUser) GetAPP() vobj.OAuthAPP

GetAPP 获取OAuth应用

func (*GithubUser) GetAvatar

func (g *GithubUser) GetAvatar() string

GetAvatar 获取头像

func (*GithubUser) GetEmail

func (g *GithubUser) GetEmail() string

GetEmail 获取邮箱

func (*GithubUser) GetNickname

func (g *GithubUser) GetNickname() string

GetNickname 获取昵称

func (*GithubUser) GetOAuthID

func (g *GithubUser) GetOAuthID() uint32

GetOAuthID 获取OAuth ID

func (*GithubUser) GetRemark

func (g *GithubUser) GetRemark() string

GetRemark 获取备注

func (*GithubUser) GetUsername

func (g *GithubUser) GetUsername() string

GetUsername 获取用户名

func (*GithubUser) String

func (g *GithubUser) String() string

String 将Github用户转换为字符串

type IOAuthUser

type IOAuthUser interface {
	fmt.Stringer
	GetOAuthID() uint32
	GetEmail() string
	GetRemark() string
	GetUsername() string
	GetNickname() string
	GetAvatar() string
	GetAPP() vobj.OAuthAPP
}

IOAuthUser OAuth用户接口

func NewOAuthRowData

func NewOAuthRowData(app vobj.OAuthAPP, row string) (IOAuthUser, error)

NewOAuthRowData 创建OAuth用户

type OauthLoginParams

type OauthLoginParams struct {
	Code    string `json:"code"`
	Email   string `json:"email"`
	OAuthID uint32 `json:"oAuthID"`
	Token   string `json:"token"`
}

OauthLoginParams OAuth登录参数

func (*OauthLoginParams) GetTokenKey added in v1.1.0

func (o *OauthLoginParams) GetTokenKey() string

GetTokenKey 返回token的key

func (*OauthLoginParams) VerifyToken added in v1.1.0

func (o *OauthLoginParams) VerifyToken(ctx context.Context, cacher cache.ISimpleCacher) error

VerifyToken 校验token是否过期

func (*OauthLoginParams) WaitVerifyToken added in v1.1.0

func (o *OauthLoginParams) WaitVerifyToken(ctx context.Context, cacher cache.ISimpleCacher) error

WaitVerifyToken 等待token验证

type RegisterWithEmailParams added in v1.1.27

type RegisterWithEmailParams struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Username string `json:"username"`
}

RegisterWithEmailParams 邮箱注册参数

Jump to

Keyboard shortcuts

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