jwt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExpired = errors.New("token expired")
)

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Uid uint32 `json:"uid"`
	jwt.StandardClaims
}

type Jwt

type Jwt struct {
	Key []byte
}

func New

func New(key []byte) *Jwt

func (*Jwt) Token

func (j *Jwt) Token(uid uint32, expireTime time.Duration) (string, error)

func (*Jwt) Valid

func (j *Jwt) Valid(tokenStr string) (uint32, error)

Jump to

Keyboard shortcuts

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