auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetDeviceCodeRes

type GetDeviceCodeRes struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURL string `json:"verification_url"`
	QrcodeURL       string `json:"qrcode_url"`
	ExpiresIn       int64  `json:"expires_in"`
	Interval        int64  `json:"interval"`
}

func GetDeviceCode

func GetDeviceCode(appKey, scope string) (*GetDeviceCodeRes, error)

获取登录使用 code 二维码

type GetDeviceTokenRes

type GetDeviceTokenRes struct {
	ExpiresIn     int32  `json:"expires_in,omitempty"`
	RefreshToken  string `json:"refresh_token,omitempty"`
	AccessToken   string `json:"access_token,omitempty"`
	SessionSecret string `json:"session_secret,omitempty"`
	SessionKey    string `json:"session_key,omitempty"`
	Scope         string `json:"scope,omitempty"`
}

func GetDeviceToken

func GetDeviceToken(appKey, secretKey, code string) (*GetDeviceTokenRes, error)

通过 code 获取用户身份 token

type GetQuotaRes

type GetQuotaRes struct {
	Total     int64 `json:"total,omitempty"`
	Free      int64 `json:"free,omitempty"`
	RequestId int64 `json:"request_id,omitempty"`
	Expire    bool  `json:"expire,omitempty"`
	Used      int64 `json:"used,omitempty"`
}

func GetQuota

func GetQuota(accessToken string) (*GetQuotaRes, error)

获取配额

type GetUserInfoRes

type GetUserInfoRes struct {
	Uk          int    `json:"uk,omitempty"`
	RequestId   string `json:"request_id,omitempty"`
	AvatarUrl   string `json:"avatar_url,omitempty"`
	BaiduName   string `json:"baidu_name,omitempty"`
	NetdiskName string `json:"netdisk_name,omitempty"`
	VipType     int32  `json:"vip_type,omitempty"`
}

func GetUserInfo

func GetUserInfo(accessToken string) (*GetUserInfoRes, error)

获取用户信息

func (GetUserInfoRes) GetVipName

func (u GetUserInfoRes) GetVipName() string

Jump to

Keyboard shortcuts

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