auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(id uint64) (string, error)

CreateToken 创建Token

Types

type Claims

type Claims struct {
	// ID 用户ID
	ID uint64 `json:"id"`
	// jwt标准载荷
	jwt.RegisteredClaims
}

Claims 自定义载荷结构,包含了一个标准的JWT载荷

func ParseToken

func ParseToken(token string) (*Claims, error)

ParseToken 解析token字符串

Jump to

Keyboard shortcuts

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