utils

package
v0.0.0-...-c435964 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLatLon

func CheckLatLon(lat, lon float64) error

CheckLatLon checks if latitude and longitude are valid

func ComparePassword

func ComparePassword(pass, hashedPass string) error

ComparePassword takes a pass and a hash and checks if the hash is the hash of this pass

func EmailFormatCheck

func EmailFormatCheck(email string) bool

EmailFormatCheck checks the validity of the email id

func GenJWTToken

func GenJWTToken(ID string) (string, time.Time, error)

GenJWTToken generates a JWT token with ID and returns the token and expiry time

func GenUUID

func GenUUID() string

GenUUID generates a UUID as string

func HashPassword

func HashPassword(password string) (string, error)

HashPassword creates the hash version of password (string)

func MustGet

func MustGet(k string) string

MustGet will return the env or panic if it is not present

func MustGetBool

func MustGetBool(k string) bool

MustGetBool will return the env as boolean or panic if it is not present

Types

This section is empty.

Jump to

Keyboard shortcuts

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