jwtutil

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToken

func NewToken(pid int64, expAt time.Time) (string, error)

func NewTokenWithData

func NewTokenWithData(pid int64, expAt time.Time, data string) (string, error)

func ParseToken

func ParseToken(tokenString string) (int64, error)

func ParseTokenData

func ParseTokenData(tokenString string) (int64, string, error)

func SetKey

func SetKey(key string)

Types

type Claims

type Claims struct {
	P int64
	E int64
	S int64
	D string `json:",omitempty"`
}

func ParseClaims

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

func (*Claims) GetSign

func (m *Claims) GetSign() int64

func (*Claims) Valid

func (m *Claims) Valid() error

Jump to

Keyboard shortcuts

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