jwt

package
v1.2.25 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY                    string = "frangoteam751"
	DEFAULT_EXPIRE_SECONDS int    = 600 // default 10 minutes

)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(info *JUser, expiredSeconds int) (tokenString string, err error)

获取jwt token

func RefreshToken

func RefreshToken(tokenString string) (string, error)

Types

type JUser

type JUser struct {
	Id     int64  `json:id`
	Groups string `json:groups`
}

func ValidateToken

func ValidateToken(tokenString string) (info JUser, err error)

验证jtw token

type MyCustomClaims

type MyCustomClaims struct {
	JUser
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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