jwt

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const TokenExpireDuration = time.Hour * 24

TokenExpireDuration 过期时间

Variables

View Source
var Secret = []byte("8./Pw52a.p4N%C37")

Secret 密钥

Functions

func GenToken

func GenToken(email string, password string) (string, error)

GenToken 生成 Token

Types

type Claims

type Claims struct {
	UserEmail string `json:"UserEmail"`
	UserPwd   string `json:"UserPwd"`
	jwt.StandardClaims
}

Claims JWT结构

func ParseToken

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

ParseToken 解析 Token

Jump to

Keyboard shortcuts

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