Documentation
¶
Index ¶
Constants ¶
View Source
const ( AdminRole = "admin" ModeratorRole = "moderator" UserRole = "user" )
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
func HashPassword ¶
HashPassword returns the bycrypt hash of the password
func RandomEmail ¶
func RandomEmail() string
func RandomOwner ¶
func RandomOwner() string
Types ¶
type Config ¶
type Config struct {
Enviroment string `mapstructure:"ENVIRONMENT"`
DBDriver string `mapstructure:"DB_DRIVER"`
DBSource string `mapstructure:"DB_SOURCE"`
HttpServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"`
GrpcServerAddress string `mapstructure:"GRPC_SERVER_ADDRESS"`
MigrationUrl string `mapstructure:"MIGRATION_URL"`
PasetoPublicKeyStr string `mapstructure:"PASETO_PUBLIC_KEY"`
PasetoPrivateKeyStr string `mapstructure:"PASETO_PRIVATE_KEY"`
PasetoPublicKey ed25519.PublicKey
PasetoPrivateKey ed25519.PrivateKey
AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"`
RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"`
RedisAddress string `mapstructure:"REDIS_ADDRESS"`
SESFromEmail string `mapstructure:"SES_FROM_EMAIL"`
SESMailRegion string `mapstructure:"SES_MAIL_REGION"`
AWSAccessKeyID string `mapstructure:"AWS_ACCESS_KEY_ID"`
AWSSecretAccessKey string `mapstructure:"AWS_SECRET_ACCESS_KEY"`
AWSDefaultRegion string `mapstructure:"AWS_DEFAULT_REGION"`
}
Config Stores all configuration env variables loaded from app.env using viper The annotations tell viper what the name of each value is in the .env file (uses map structure)
func LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.