auth

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthCodeURL

func GetAuthCodeURL(req *AuthCodeReq) string

func SetEnv

func SetEnv(env *AuthEnv)

Types

type AuthCodeReq

type AuthCodeReq struct {
	ResponseType string `query:"response_type" default:"code"`
	ClientId     string `query:"client_id" default:"$CLIENT_ID"`
	RedirectUri  string `query:"redirect_uri" default:"$REDIRECT_URI"`
	Scope        string `query:"scope" default:"basic,netdisk"`
	DeviceId     string `query:"device_id"`
}

type AuthEnv

type AuthEnv struct {
	ClientId     string
	ClientSecret string
	RedirectUri  string
	AccessToken  string
	RefreshToken string
}

type GetTokenReq

type GetTokenReq struct {
	ClientId     string `query:"client_id" default:"$CLIENT_ID"`
	ClientSecret string `query:"client_secret" default:"$CLIENT_SECRET"`
	Code         string `query:"code"`
	GrantType    string `query:"grant_type" default:"authorization_code"`
	RedirectUri  string `query:"redirect_uri" default:"$REDIRECT_URI"`
}

type GetTokenRes

type GetTokenRes struct {
	AccessToken   string `json:"access_token"`
	ExpiresIn     int64  `json:"expires_in"`
	RefreshToken  string `json:"refresh_token"`
	Scope         string `json:"scope"`
	SessionKey    string `json:"session_key"`
	SessionSecret string `json:"session_secret"`
}

func GetToken

func GetToken(req *GetTokenReq) (*GetTokenRes, error)

func RefreshToken

func RefreshToken(req *RefreshTokenReq) (*GetTokenRes, error)

type RefreshTokenReq

type RefreshTokenReq struct {
	ClientId     string `query:"client_id" default:"$CLIENT_ID"`
	ClientSecret string `query:"client_secret" default:"$CLIENT_SECRET"`
	GrantType    string `query:"grant_type" default:"refresh_token"`
	RefreshToken string `query:"refresh_token" default:"$REFRESH_TOKEN"`
}

Jump to

Keyboard shortcuts

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