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() int64
- func RandomOwner() string
- func RandomString(n int) string
- type Config
Constants ¶
View Source
const ( USD = "USD" EUR = "EUR" COP = "COP" )
Constantes para todo tipo de monedas
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword verifica si la contraseña porporcionada es correcta o no
func HashPassword ¶
HashPassword devuelve el hash bcrypt de la contraseña
func IsSupportedCurrency ¶
IsSupportedCurrency devuelve true si la moneda es soportada
func RandomCurrency ¶
func RandomCurrency() string
RandomCurrency genera un código de cambio de divisas aleatorio.
func RandomEmail ¶
func RandomEmail() string
func RandomString ¶
RandomString genera una cadena alatoria de la longitud n
Types ¶
type Config ¶
type Config struct { DBDriver string `mapstructure:"DB_DRIVER"` DBSource string `mapstructure:"DB_SOURCE"` ServerAddress string `mapstructure:"SERVER_ADDRESS"` TokenSymetricKey string `mapstructure:"TOKEN_SYMETRIC_KEY"` AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` }
Config almacena toda la configuración de la aplicación. Los valores son leídos por viper desde el archivo de configuración o variables de entorno.
func LoadConfig ¶
LoadConfig lee la configuración desde el archivo o variables de entorno.
Click to show internal directories.
Click to hide internal directories.