Documentation
¶
Index ¶
- func CheckPassword(password string, hashedPassword []byte) error
- func Contains(slice []int64, element int64) bool
- func HashPassword(password string) ([]byte, error)
- func Rand() *rand.Rand
- func RandomCard() int64
- func RandomDessertName() string
- func RandomEmail() string
- func RandomIngredient() string
- func RandomPoints() int32
- func RandomString(n int) string
- func RandomSymmetricKey() string
- func RandomUsername() string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
func HashPassword ¶
func RandomCard ¶
func RandomCard() int64
func RandomEmail ¶
func RandomEmail() string
func RandomIngredient ¶
func RandomIngredient() string
RandomIngredient generates a random ingredient.
func RandomPoints ¶
func RandomPoints() int32
getRandomPoints returns a random integer between 1 and 10
func RandomString ¶
RandomString generates a random string of length n
func RandomSymmetricKey ¶
func RandomSymmetricKey() string
func RandomUsername ¶
func RandomUsername() string
Types ¶
type Config ¶
type Config struct { DBDriver string `mapstructure:"DB_DRIVER"` DBSource string `mapstructure:"DB_SOURCE"` TestDBSource string `mapstructure:"TEST_DB_SOURCE"` MigrationURL string `mapstructure:"MIGRATION_URL"` HTTPServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"` GRPCServerAddress string `mapstructure:"GRPC_SERVER_ADDRESS"` FrontendAddress string `mapstructure:"FRONTEND_ADDRESS"` TokenSymmetricKey string `mapstructure:"TOKEN_SYMMETRIC_KEY"` AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"` SmtpHost string `mapstructure:"SMTP_HOST"` SmtpPort int `mapstructure:"SMTP_PORT"` SmtpUsername string `mapstructure:"SMTP_USERNAME"` SmtpPassword string `mapstructure:"SMTP_PASSWORD"` SmtpSender string `mapstructure:"SMTP_SENDER"` }
TODO: Look into changing TokenSymmetricKey to Asymmetric in production.
func LoadConfig ¶
LoadConfig reads configuration from file or environment variables.
Click to show internal directories.
Click to hide internal directories.