Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustGetEnv ¶
MustGetEnv gather environment variable and convert it to an int value. Panics if it fail
func MustGetEnvInt ¶
MustGetEnvInt gather environment variable and convert it to an int value. Panics if it fail
Types ¶
type Config ¶
type Config interface { GetHost() string GetPort() string GetClientHost() string GetClientPort() string GetLogLevel() int }
Config represents a Gabble Server configuration
type EnvConfig ¶
type EnvConfig struct {
// contains filtered or unexported fields
}
EnvConfig satisfies Gabble server configuration from a .env file
func FromEnvFile ¶
FromEnvFile reads configuration from a .env file located in the CWD and returns a EnvConfig
func (*EnvConfig) GetClientHost ¶
GetClientHost returns the "SERVER_PORT" value from the .env file
func (*EnvConfig) GetClientPort ¶
GetClientPort returns the "SERVER_PORT" value from the .env file
func (*EnvConfig) GetLogLevel ¶
GetLogLevel returns the "LOG_LEVEL" value from the .env file
type OSEnvConfig ¶
type OSEnvConfig struct {
// contains filtered or unexported fields
}
OSEnvConfig satisfies Gabble server configuration from OS environment variables
func FromOsEnv ¶
func FromOsEnv() (*OSEnvConfig, error)
FromOsEnv reads configuration from the OS environment variables
func (*OSEnvConfig) GetClientHost ¶
func (conf *OSEnvConfig) GetClientHost() string
GetClientHost returns the "SERVER_PORT" value from the .env file
func (*OSEnvConfig) GetClientPort ¶
func (conf *OSEnvConfig) GetClientPort() string
GetClientPort returns the "SERVER_PORT" value from the .env file
func (*OSEnvConfig) GetHost ¶
func (conf *OSEnvConfig) GetHost() string
GetHost returns the "SERVER_HOST" value from the .env file
func (*OSEnvConfig) GetLogLevel ¶
func (conf *OSEnvConfig) GetLogLevel() int
GetLogLevel returns the "LOG_LEVEL" value from the .env file
func (*OSEnvConfig) GetPort ¶
func (conf *OSEnvConfig) GetPort() string
GetPort returns the "SERVER_PORT" value from the .env file