utils

package
v0.0.0-...-341268e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppPath string = getAppPath()

AppPath returns a tring of the current application path

View Source
var (
	DB = db.DB{DBPath: LucidHomeDir() + "/lucid.db"}
)

Functions

func CheckError

func CheckError(err error)

CheckError takes in an error value and handles it by logging its output

func CreatePasswordHash

func CreatePasswordHash(password string) ([]byte, bool)

CreatePasswordHash creates a bcrypt has with a default cost added

func CreateToken

func CreateToken() (string, error)

CreateToken generates a jwt string token and an error

func LucidHomeDir

func LucidHomeDir() string

LucidHomeDir is the deafult configuration directory on the syste

func PasswordHashCompare

func PasswordHashCompare(password string, hash string) bool

PasswordHashCompare checks whether the password and hash in the database cryptographically match

func VerifyToken

func VerifyToken(tokenString string) (bool, error)

VerifyToken takes in a string token. Then returns a boolean and an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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