Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigEnvironmentVariable = "CONFIG"
ConfigEnvironmentVariable is the expected environment variable storing JSON configuration data.
View Source
const DefaultGraceful = 5
DefaultGraceful is the graceful shutdown timeout applied when no configuration value is given.
Variables ¶
This section is empty.
Functions ¶
func EnvironmentName ¶
EnvironmentName returns the name of the current execution environment from CONFIG. If no environment is detected, "local" is returned.
func FromEnvironment ¶
FromEnvironment unmarshals JSON configuration from the CONFIG environment variable into dst.
Types ¶
type MongoDB ¶
type MongoDB struct { URI string `json:"uri"` ConnectTimeout time.Duration `json:"connect_timeout"` MaxConnIdleTime *time.Duration `json:"max_conn_idle_time"` MaxConnecting *uint64 `json:"max_connecting"` MaxPoolSize *uint64 `json:"max_pool_size"` MinPoolSize *uint64 `json:"min_pool_size"` }
MongoDB configures a connection to a Mongo database.
type Redis ¶
type Redis struct { URI string `json:"uri"` DialTimeout time.Duration `json:"dial_timeout"` ReadTimeout time.Duration `json:"read_timeout"` WriteTimeout time.Duration `json:"write_timeout"` }
Redis configures a connection to a Redis database.
type Server ¶
type Server struct { Addr string `json:"addr"` // Graceful enables graceful shutdown and is the time in seconds to wait // for all outstanding requests to terminate before forceably killing the // server. When no value is given, DefaultGraceful is used. Graceful // shutdown is disabled when less than zero. Graceful int `json:"graceful"` }
Server configures the binding and security of an HTTP server.
Click to show internal directories.
Click to hide internal directories.