utils

package
v0.0.0-...-5320309 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB     db
	App    app
	Log    log
	Config = &config{
		DB:  &DB,
		App: &App,
		Log: &Log,
	}
)

Functions

func GenerateJWT

func GenerateJWT(payload map[string]string) (string, error)

func GeneratePasswordHash

func GeneratePasswordHash(password string) (string, error)

func ParseJWT

func ParseJWT(tokenString string) (*jwt.Token, error)

func RetrieveJWT

func RetrieveJWT(token *jwt.Token) (jwt.MapClaims, error)

func VerifyJWT

func VerifyJWT(token *jwt.Token) bool

func VerifyPassword

func VerifyPassword(password, passwordHash string) bool

Types

type Claims

type Claims struct {
	Payload map[string]string
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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