jwt

package
v0.0.0-...-3caf815 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTokenInvalid = errors.New("Jwt token invalid")

ErrTokenInvalid token不合法错误

Functions

This section is empty.

Types

type Claims

type Claims map[string]interface{}

Claims payload内容

type Token

type Token struct {
	// contains filtered or unexported fields
}

Token token对象

func New

func New(key string) *Token

New 创建一个Token

func (*Token) CreateToken

func (jt *Token) CreateToken(payloads Claims, expire time.Duration) string

CreateToken 创建Token

func (*Token) ParseToken

func (jt *Token) 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