hujwt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(id, power string, hours time.Duration) (string, error)

产生token的函数

func SetjwtSecret

func SetjwtSecret(mySecret string)

Types

type Claims

type Claims struct {
	ID    string `json:"id"`
	Power string `json:"power"`
	jwt.StandardClaims
}

func ParseToken

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

验证token的函数

Jump to

Keyboard shortcuts

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