Documentation ¶
Index ¶
- Constants
- func CheckPassword(password string, hashedPassword string) error
- func HashPassword(password string) (string, error)
- func IsSupportedCurrency(currency string) bool
- func RandomCurrency() string
- func RandomEmail() string
- func RandomInt(min, max int64) int64
- func RandomMoney() decimal.Decimal
- func RandomOwner() string
- func RandomString(n int) string
- type Config
Constants ¶
View Source
const ( GBP = "GBP" HKD = "HKD" USD = "USD" )
Constants for all supported currencies
View Source
const ( DepositorRole = "depositor" BankerRole = "banker" )
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword checks if supplied password matches the hashedPassword, returning an error if not
func HashPassword ¶
HashPassword returns the bcrypt hash of the password
func IsSupportedCurrency ¶
func RandomCurrency ¶
func RandomCurrency() string
RandomCurrency generates a random currency string
func RandomMoney ¶
RandomMoney generates a random amount of money
func RandomString ¶
RandomString generates a random string of length n
Types ¶
type Config ¶
type Config struct { Environment string `mapstructure:"ENVIRONMENT"` DBSource string `mapstructure:"DB_SOURCE"` MigrationURL string `mapstructure:"MIGRATION_URL"` HTTPServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"` GRPCServerAddress 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"` RedisAddress string `mapstructure:"REDIS_ADDRESS"` EmailSenderName string `mapstructure:"EMAIL_SENDER_NAME"` EmailSenderAddress string `mapstructure:"EMAIL_SENDER_ADDRESS"` EmailSenderPassword string `mapstructure:"EMAIL_SENDER_PASSWORD"` }
Config contains all app configuration Values are sourced by viper from config file or environment variables
func LoadConfig ¶
LoadConfig sources app configuration from config file or environment variables
Click to show internal directories.
Click to hide internal directories.