util

package
v0.0.0-...-6844190 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashedPassword

func HashedPassword(password string) (string, error)

HashedPassword returns a stringify hash of the password.

func RandomEmail

func RandomEmail() string

RandomEmail returns a random email.

func RandomNumber

func RandomNumber(min, max int64) int64

RandomNumber returns a random number between min and max integers.

func RandomPasswordHash

func RandomPasswordHash(passwordLength int) string

RandomPasswordHash generates a random hash of a string.

func RandomString

func RandomString(length int) string

RandomString generates random string value

func RandomWebsiteURL

func RandomWebsiteURL() string

RandomWebsiteURL returns a random website url.

func VerifyPassword

func VerifyPassword(hashedPassword, password string) error

VerifyPassword checks the hashed password against the cleartext password.

Types

type Configs

type Configs struct {
	DBDriver             string        `mapstructure:"DB_DRIVER"`
	DBSource             string        `mapstructure:"DB_SOURCE"`
	ServerAddress        string        `mapstructure:"SERVER_ADDRESS"`
	SymmetricKey         string        `mapstructure:"TOKEN_SYMMETRIC_KEY"`
	SessionTokenDuration time.Duration `mapstructure:"SESSION_TOKEN_DURATION"`
}

A Configs defines the expected config values.

func ParseConfigs

func ParseConfigs(path string) (configs Configs, err error)

ParseConfigs parses the configuration files.

Jump to

Keyboard shortcuts

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