Documentation
¶
Index ¶
- Constants
- func CheckPassword(password, hashedPassword string) error
- func HashPassword(password string) (string, error)
- func IsSupported(currency string) bool
- func RandomCurrency() string
- func RandomEmail() string
- func RandomInt(min, max int64) int64
- func RandomMoney() int64
- func RandomOwner() string
- func RandomString(n int) string
- type Config
Constants ¶
View Source
const ( USD = "USD" EUR = "EUR" CAD = "CAD" )
all supported currencies
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
checks if the provided password is correct or not
func HashPassword ¶
returns the bcrypt hash of a password
func IsSupported ¶
func RandomEmail ¶
func RandomEmail() string
Types ¶
type Config ¶
type Config struct { AppEnv string `mapstructure:"APP_ENV"` DBSource string `mapstructure:"DB_SOURCE"` MigrationURL string `mapstructure:"MIGRATION_URL"` RedisAddress string `mapstructure:"REDIS_ADDRESS"` HTTP_ServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"` GRPC_ServerAddress string `mapstructure:"GRPC_SERVER_ADDRESS"` TokenSymmetricKey string `mapstructure:"TOKEN_SYMMETRIC_KEY"` AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"` EmailSenderName string `mapstructure:"EMAIL_SENDER_NAME"` EmailSenderPassword string `mapstructure:"EMAIL_SENDER_PASSWORD"` EmailSenderAddress string `mapstructure:"EMAIL_SENDER_Address"` }
stores all configurations of the application. values are read by viper from the config file or environment variables
func LoadConfig ¶
func (*Config) FetchDBSource ¶
Click to show internal directories.
Click to hide internal directories.