util

package
v0.0.0-...-2c8b9bc Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvProduction  = "production"
	EnvDevelopment = "development"
)

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hashedPassword string) error

func HashPassword

func HashPassword(password string) (string, error)

func RandomEmail

func RandomEmail() string

func RandomInt

func RandomInt(min, max int64) int64

func RandomString

func RandomString(n int) string

func RandomURL

func RandomURL() string

func RandomUsername

func RandomUsername() string

func ValidateEmail

func ValidateEmail(value string) error

func ValidateID

func ValidateID(value int64) error

func ValidatePassword

func ValidatePassword(value string) error

func ValidateString

func ValidateString(value string, min, max int) error

func ValidateURL

func ValidateURL(value string) error

func ValidateUsername

func ValidateUsername(value string) error

Types

type Config

type Config struct {
	Environment string `mapstructure:"ENVIRONMENT"`

	PostgresSource string `mapstructure:"POSTGRES_SOURCE"`
	MongoSource    string `mapstructure:"MONGO_SOURCE"`

	ServerType string `mapstructure:"SERVER_TYPE"`
	ServerPort int    `mapstructure:"SERVER_PORT"`

	LogType string `mapstructure:"LOG_TYPE"`
	DBType  string `mapstructure:"DB_TYPE"`

	TokenSymmetricKey string `mapstructure:"TOKEN_SYMMETRIC_KEY"`

	TestRepo string `mapstructure:"TEST_REPO"`
}

func LoadConfig

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

func (Config) IsProduction

func (c Config) IsProduction() bool

func (Config) IsTestAllRepo

func (c Config) IsTestAllRepo() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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