Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPassword(password string, hashedPassword string) error
- func HashedPassword(password string) (string, error)
- func IsSupportCurrency(currency string) bool
- func RandomCurrency() string
- func RandomEmail() string
- func RandomHashedPassword() 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" INR = "INR" )
Variables ¶
View Source
var ( ErrExpiredToken = errors.New("token has expired") ErrInvalidToken = errors.New("token is invalid") )
Functions ¶
func CheckPassword ¶
CheckPassword checks if the password is correct
func HashedPassword ¶
HashedPassword return the bcrypt hash of the password
func IsSupportCurrency ¶
IsSupportCurrency checks if currency is supported
func RandomHashedPassword ¶
func RandomHashedPassword() string
RandomHashedPassword generates a random hashed password
func RandomString ¶
RandomString generates a random string of length n
Types ¶
type Config ¶
type Config struct { DBDriverPostgres string `mapstructure:"DB_DRIVER_POSTGRES"` DBSourcePostgres string `mapstructure:"DB_SOURCE_POSTGRES"` ServerAddress string `mapstructure:"SERVER_ADDRESS"` }
Config is the configuration for the application
func LoadConfig ¶
LoadConfig loads config from file
Click to show internal directories.
Click to hide internal directories.