token

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const JwtAuthIdentifier = "dysodeng.com/dysodeng/app/auth"

Variables

This section is empty.

Functions

func VerifyToken

func VerifyToken(token string) (map[string]interface{}, error)

VerifyToken 验证用户token

Types

type AuthCodeToken

type AuthCodeToken struct {
	Token  json.Token
	Expire int64 `json:"expire"`
}

AuthCodeToken 核验码token数据结构

type Token

type Token struct {
	Registered         bool        `json:"registered"` // 用户是否已注册
	Token              json.Token  `json:"token"`
	Expire             int64       `json:"expire"`
	RefreshToken       json.Token  `json:"refresh_token"`
	RefreshTokenExpire int64       `json:"refresh_token_expire"`
	Attach             interface{} `json:"attach,omitempty"`
}

Token token 数据结构

func GenerateToken

func GenerateToken(userType string, data map[string]interface{}, attach map[string]interface{}) (Token, error)

GenerateToken 构建用户token

Jump to

Keyboard shortcuts

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