Documentation ¶
Index ¶
- type Config
- func (c Config) Get404() string
- func (c Config) GetAddress() string
- func (c Config) GetIdleTimeout() time.Duration
- func (c Config) GetIndexHTML() string
- func (c Config) GetLivenessCheckInterval() (time.Duration, error)
- func (c Config) GetReadTimeout() time.Duration
- func (c Config) GetStopTimeout() time.Duration
- func (c Config) GetWriteTimeout() time.Duration
- func (c Config) IsProd() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Static string IP string Port string ReadTimeout int WriteTimeout int StopTimeout int IdleTimeout int Prod bool }
Config manages the configuration options of the program. All members are unexported, accessed solely through member methods
func New ¶
func New() *Config
New construct and returns a config with default values, for use in testing server. Static dir defaults to dev value, Build() will overwrite with cwd
func (Config) GetAddress ¶
GetAddress returns the address:port of the server and port to listen on
func (Config) GetIdleTimeout ¶
GetIdleTimeout returns the time.Duration of the idle timeout
func (Config) GetIndexHTML ¶
GetIndexHTML returns the filename of the html page
func (Config) GetLivenessCheckInterval ¶
GetLivenessCheckInterval returns the interval on which to conduct liveness checks in production, uses socket to get httpd.service watchdog interval from systemd daemon
func (Config) GetReadTimeout ¶
GetReadTimeout returns the time.Duration of the read timeout
func (Config) GetStopTimeout ¶
GetStopTimeout returns the time.Duration of the stop timeout
func (Config) GetWriteTimeout ¶
GetWriteTimeout returns the time.Duration of the write timeout