utils

package
v0.0.0-...-a38e679 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password, hash string) error

func GetEnv

func GetEnv(key string, defaultValue string) string

GetEnv will return the value of an environment variable if it exists otherwise it will return the supplied defaultValue

func GetEnvAsBool

func GetEnvAsBool(key string, defaultValue string) bool

GetEnvAsBool will return an environment var if it exists, parsed as a bool If parsing fails, false is returned. Otherwise the default value is returned

func HashPassword

func HashPassword(password string) (string, error)

func RandomHex

func RandomHex(n int) (string, error)

RandomHex will create random n bytes and return formatted as a hex string. The string length will be double the byte length.

func ValidatePassword

func ValidatePassword(password, hash string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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