util

package
v0.0.0-...-31933a3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	USD = "USD"
	EUR = "EUR"
	CAD = "CAD"
	HRK = "HRK"
)

Constants for all supported currencies

View Source
const (
	DepositorRole = "depositor"
	BankRole      = "bank"
)

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hashedpassword string) error

func HashPassword

func HashPassword(password string) (string, error)

func IsSupportedCurrency

func IsSupportedCurrency(currency string) bool

func RadnomMoney

func RadnomMoney() int64

func RadnomString

func RadnomString(n int) string

func RandomCurrency

func RandomCurrency() string

func RandomEmail

func RandomEmail() string

Random email generates a random email

func RandomInt

func RandomInt(min, max int64) int64

func RandomOwner

func RandomOwner() string

Types

type Config

type Config struct {
	Environment          string        `mapstructure:"ENVIROMENT"`
	DBSource             string        `mapstructure:"DB_SOURCE"`
	MigrationURL         string        `mapstructure:"MIGRATION_URL"`
	RedisAddress         string        `mapstructure:"REDIS_ADDRESS"`
	HTTPServerAdress     string        `mapstructure:"HTTP_SERVER_ADRESS"`
	GRPCServerAdress     string        `mapstructure:"GRPC_SERVER_ADRESS"`
	TokenSymetricKey     string        `mapstructure:"TOKEN_SYMETRIC_KEY"`
	AccessTokenDuration  time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"`
	RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"`
	EmailSenderName      string        `mapstructure:"EMAIL_SENDER_NAME"`
	EmailSenderAddress   string        `mapstructure:"EMAIL_SENDER_ADDRESS"`
	EmailSenderPassword  string        `mapstructure:"EMAIL_SENDER_PASSWORD"`
}

Config sotres all config of the aplicaton the values are read by viper from a config file

func LoadConfig

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

Reads config file or env var

Jump to

Keyboard shortcuts

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