jwt

package
v0.0.0-...-8e399c3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(id uint, username string) (string, time.Time, error)

GenerateToken generate tokens used for auth

func SetJwtSecret

func SetJwtSecret(secret string)

func Setup

func Setup()

Types

type Claims

type Claims struct {
	// token 不能保存密码等敏感信息,因为是可以随便解密的
	jwtGo.StandardClaims
	Id       uint   `json:"id"`
	UserName string `json:"username"`
}

func ParseToken

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

ParseToken parsing token

Jump to

Keyboard shortcuts

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