Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvSettings ¶
type EnvSettings struct { EnvHTTPListenPort int `envconfig:"HTTP_PORT" default:"8080"` EnvLogLevel string `envconfig:"LOG_LEVEL" default:"info"` EnvStorageFilePath string `envconfig:"STORAGE_FILEPATH" default:"jobtome.dat"` }
EnvSettings reads settings from environment variables.
func NewEnvSettings ¶
func NewEnvSettings(prefix string) (EnvSettings, error)
NewEnvSettings returns EnvSettings initialized from environment variables. `prefix` allows to add an extra prefix that needs to be used with all env var names.
func (EnvSettings) HTTPPort ¶
func (es EnvSettings) HTTPPort() int
HTTPPort returns a port number to listening for incoming HTTP connections.
func (EnvSettings) LogLevel ¶
func (es EnvSettings) LogLevel() string
LogLevel returns a logging level.
func (EnvSettings) StorageFilePath ¶
func (es EnvSettings) StorageFilePath() string
StorageFilePath returns path to the file to use as persisted storage.
Click to show internal directories.
Click to hide internal directories.