Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ServerConfig ¶
type ServerConfig struct { Protocol string `mapstructure:"SERVER_PROTOCOL"` Host string `mapstructure:"SERVER_HOST" required:"true"` Port string `mapstructure:"SERVER_PORT" required:"true"` LogLevel string `mapstructure:"SERVER_LOG_LEVEL"` StaticFilesRoot string `mapstructure:"STATIC_FILES_ROOT"` HTMLTemplateFilesRoot string `mapstructure:"HTML_TEMPLATE_FILES_ROOT"` }
ServerConfig represents the default server configuration.
func LoadServerConfig ¶
func LoadServerConfig() (*ServerConfig, *errors.Error)
LoadServerConfig loads configuration from the environment and returns a ServerConfig instance. If values are not provided for ServerConfig.Host and ServerConfig.Port a error will be returned and if values are not provided for ServerConfig.Protocol and ServerConfig.StaticFilesRoot a default value is set. default values:
ServerConfig.Protocol = https ServerConfig.StaticFilesRoot = / ServerConfig.HTMLTemplateFilesRoot = /
Click to show internal directories.
Click to hide internal directories.