auther

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UserIDKey = "userID"

Variables

This section is empty.

Functions

func GenToken

func GenToken(userID int64) (string, error)

func GetInfo

func GetInfo(token string) (int64, error)

func RefreshToken

func RefreshToken(accessToken, refreshToken string) (newAToken, newRToken string, err error)

RefreshToken 刷新AccessToken

func SignPermanentToken

func SignPermanentToken(signBy string) (string, error)

Types

type PerToken

type PerToken struct {
	SignTo string `json:"sign_to"`
	jwt.StandardClaims
}

type Token

type Token struct {
	UserID int64 `json:"user_id"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*Token, error)

ParseToken 解析JWT

Jump to

Keyboard shortcuts

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