oauth

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 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 LoginInfo

type LoginInfo struct {
	Type      string `json:"type"`
	LoginTime string `json:"login_time"`
	AppID     string `json:"appid"`
}

type OAuth

type OAuth struct {
	// contains filtered or unexported fields
}

func NewOAuth

func NewOAuth(account contracts.AccountInterface, opts ...Option) *OAuth

func (*OAuth) CodeToVerifyInfo

func (o *OAuth) CodeToVerifyInfo(code string) (*VerifyInfo, error)

type Option

type Option func(auth *OAuth)

func WithLocker

func WithLocker(locker lock.Locker) Option

WithLocker 设置锁

type UserInfo

type UserInfo struct {
	UserID      string `json:"user_id"`
	OpenAppInfo struct {
		AppID      string `json:"appid"`
		OpenID     string `json:"openid"`
		UnionID    string `json:"unionid"`
		HeadImgUrl string `json:"headimgurl"`
		Nickname   string `json:"nickname"`
	} `json:"openapp_info"`
	PhoneInfo struct {
		Phone string `json:"phone"`
	} `json:"phone_info"`
	AppleInfo struct {
		BundleID    string `json:"bundleid"`
		AppleUserID string `json:"apple_user_id"`
	} `json:"apple_info"`
	MiniProgramInfo struct {
		AppID   string `json:"appid"`
		OpenID  string `json:"openid"`
		UnionID string `json:"unionid"`
	} `json:"miniprogram_info"`
}

type VerifyInfo

type VerifyInfo struct {
	LoginInfo LoginInfo `json:"login_info"`
	UserInfo  UserInfo  `json:"user_info"`
}

Jump to

Keyboard shortcuts

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