jwt

package
v0.0.0-...-7f9fecb Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SECRET_KEY = []byte(os.Getenv("JWT_KEY"))
	EXP_HOUR   = 24
	EXP_MINUTE = 15
)

Functions

func New

func New() *jwtService

Types

type JWTFields

type JWTFields struct {
	UserID int
	Name   string
	Email  string
}

type JWTServices

type JWTServices interface {
	Generate(data JWTFields) (map[string]string, error)
	ValidateToken(token string) (*jwt.Token, error)
}

Jump to

Keyboard shortcuts

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