util

package
v0.0.0-...-4512218 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hashpassword string) error

func HashPassword

func HashPassword(password string) (string, error)

GeneratePasswordHash generates a password hash using the bcrypt algorithm

func RandomApp

func RandomApp() string

func RandomEmail

func RandomEmail() string

func RandomInt

func RandomInt(min, max int64) int64

func RandomString

func RandomString(n int) string

Types

type Config

type Config struct {
	DBDriver            string        `mapstructure:"DB_DRIVER"`
	DBSource            string        `mapstructure:"DB_SOURCE"`
	ServerAddress       string        `mapstructure:"SERVER_ADDRESS"`
	Environment         string        `mapstructure:"ENVIRONMENT"`
	TokenSymmetricKey   string        `mapstructure:"TOKEN_SYMMETRIC_KEY"`
	AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"`
}

Config struct for the app.env file

func LoadConfig

func LoadConfig(path string) (config Config, err error)

Load app.env file, this file is set as environment variables in container

Jump to

Keyboard shortcuts

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