Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &Configuration{}
Config is the global configuration variable
Functions ¶
func LoadConfiguration ¶
func LoadConfiguration(config *Configuration)
LoadConfiguration loads the configuration from environment variables
Types ¶
type Configuration ¶
type Configuration struct { // Application Debug bool `env:"DEBUG"` Port string `env:"PORT"` Name string `env:"NAME"` Domain string `env:"DOMAIN"` // Database DBHost string `env:"DB_HOST"` // Database host address DBPort string `env:"DB_PORT"` // Database port DBUsername string `env:"DB_USERNAME"` // Database username DBPassword string `env:"DB_PASSWORD"` // Database password DBDatabase string `env:"DB_DATABASE"` // Database name // Only required if DEBUG is false MailHost string `env:"MAIL_HOST"` MailPort string `env:"MAIL_PORT"` MailSecure bool `env:"MAIL_SECURE"` MailUsername string `env:"MAIL_AUTH_USERNAME"` MailPassword string `env:"MAIL_AUTH_PASSWORD"` MailSender string `env:"MAIL_SENDER"` MailReply string `env:"MAIL_REPLY"` }
Configuration holds all the configuration settings for the application. It uses struct tags to map environment variables to struct fields.
The reason why database is not separated from the Configuration struct is because there would need to be extra logic to load the database configuration from the environment variables.
Click to show internal directories.
Click to hide internal directories.