jwt

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTimeoutToken

func MakeTimeoutToken(data string, secretKey string, timeout int64) (string, error)

MakeTimeoutToken 创建一个会过期的token

func ParseToken

func ParseToken(secretKey, token string) (string, error)

ParseToken 解析 token

Types

type JWT

type JWT struct {
	SigningKey []byte
}

func NewJWT

func NewJWT(secretKey string) *JWT

func (*JWT) CreateToken

func (j *JWT) CreateToken(data string, timeout int64) (string, error)

CreateToken 创建一个token

func (*JWT) ParseToken

func (j *JWT) ParseToken(token string) (string, error)

ParseToken 解析 token

Jump to

Keyboard shortcuts

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