jwt

package
v0.0.0-...-228285a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TokenExpireDuration = time.Minute * 60

Variables

View Source
var MySecret = []byte("yuki")

Functions

func GenToken

func GenToken(userid int64) (strToken string, err error)

GenToken 根据id生成token

Types

type MyClaims

type MyClaims struct {
	UserId int64 `json:"user_id"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*MyClaims, error)

ParseToken 解析JWT

Jump to

Keyboard shortcuts

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