util

package
v0.0.0-...-f694c19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(hashedPassword, newPassword string) bool

func GenerateUuid

func GenerateUuid() string

func GenericRandomString

func GenericRandomString(n int) string

func HashPassword

func HashPassword(s string) (string, error)

func RandomEmail

func RandomEmail() string

RandomEmail generates a random email

func RandomInt

func RandomInt(min, max int64) int64

RandomInt generates a random integer between min and max

func RandomName

func RandomName() string

RandomName generates a random (first/last) name

func RandomPassword

func RandomPassword() string

func RandomString

func RandomString(n int, s string) string

RandomString generates a random string of length n

func RandomUuid

func RandomUuid() string

RandomUuid generates a random uuid

Types

type Config

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

func LoadConfig

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

Jump to

Keyboard shortcuts

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