Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AppName string `env:"APP_NAME" envDefault:"boilerplate"`
ServerPort int `env:"PORT" envDefault:"8000"`
Env string `env:"ENV" envDefault:"env not set"`
LogLevel string `env:"LOG_LEVEL" envDefault:"debug"`
LogOutput string `env:"LOG_OUTPUT" envDefault:"console"`
// NewRelicKey let it blank to disable newrelic
NewRelicKey string `env:"NEWRELIC_KEY" envDefault:""`
IdleTimeout time.Duration `env:"IDLE_TIMEOUT" envDefault:"5s"`
// WriteTimeout maximum time the server will handle a request before timing out writes of the response.
// It must be bigger than RequestTimeout
WriteTimeout time.Duration `env:"WRITE_TIMEOUT" envDefault:"4s"`
// RequestTimeout the timeout for the incoming request set on the request handler
RequestTimeout time.Duration `env:"REQUEST_TIMEOUT" envDefault:"2s"`
ReadHeaderTimeout time.Duration `env:"READ_HEADER_TIMEOUT" envDefault:"1s"`
// ShutdownTimeout the time the sever will wait server.Shutdown to return
ShutdownTimeout time.Duration `env:"SHUTDOWN_TIMEOUT" envDefault:"6s"`
}
Config - environment variables are parsed to this struct
Click to show internal directories.
Click to hide internal directories.