Documentation ¶
Index ¶
- Constants
- func HashPasswordBcrypt(password string) (string, error)
- func HashPasswordBlake(password string) string
- func IsSupportedCurrency(currency string) bool
- func RandomCurrency() string
- func RandomEmail() string
- func RandomFullname() string
- func RandomInt(min, max int64) int64
- func RandomMoneyAmount() int64
- func RandomOwner() string
- func RandomPassword() string
- func RandomString(length int) string
- func VerifyPasswordBcrypt(password string, hashedpassword string) error
- func VerifyPasswordBlake(password string, hashedpassword string) bool
- type Config
Constants ¶
View Source
const ( USD = "USD" EUR = "EUR" TRY = "TRY" )
Variables ¶
This section is empty.
Functions ¶
func HashPasswordBcrypt ¶
HashPasswordBcrypt hashes a password using bcrypt, and returns it as a string
func HashPasswordBlake ¶
HashPassword hashes a password using blake2b, encodes it to hex, and returns it as a string
func IsSupportedCurrency ¶
IsSupportedCurrency returns true if given currency is supported
func RandomCurrency ¶
func RandomCurrency() string
func RandomEmail ¶
func RandomEmail() string
func RandomFullname ¶
func RandomFullname() string
func RandomMoneyAmount ¶
func RandomMoneyAmount() int64
func RandomOwner ¶
func RandomOwner() string
func RandomPassword ¶
func RandomPassword() string
func RandomString ¶
func VerifyPasswordBcrypt ¶
VerifyPasswordBcrypt verifies a password using bcrypt.
func VerifyPasswordBlake ¶
VerifyPasswordBlake verifies a password using blake2b. Returns true if the password matches the hash
Types ¶
type Config ¶
type Config struct { Environment string `mapstructure:"ENVIRONMENT"` DB_Source string `mapstructure:"DB_SOURCE"` Migration_Url 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"` }
func LoadConfig ¶
TODO check env to differantiate between env to apply different configs for dev, test, prod
Click to show internal directories.
Click to hide internal directories.