token

package
v0.0.0-...-9489f8d Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TOKEN_EXP = time.Hour * 24
)

Functions

func GenToken

func GenToken(payload interface{}, key []byte, opts ...TokenOption) (string, error)

func VerifyToken

func VerifyToken(token string, key []byte) (interface{}, error)

Types

type PayLoad

type PayLoad map[string]interface{}

type TokenOption

type TokenOption interface {
	// contains filtered or unexported methods
}

func WithExp

func WithExp(exp time.Duration) TokenOption

Jump to

Keyboard shortcuts

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