2015-05-29 19:50:05 +00:00
|
|
|
package httpd
|
|
|
|
|
2016-02-25 11:17:59 +00:00
|
|
|
// DefaultBindAddress is the default address to bind to.
|
|
|
|
const DefaultBindAddress = ":8086"
|
|
|
|
|
2015-11-22 19:23:56 +00:00
|
|
|
// Config represents a configuration for a HTTP service.
|
2015-05-29 19:50:05 +00:00
|
|
|
type Config struct {
|
2015-07-17 23:54:06 +00:00
|
|
|
Enabled bool `toml:"enabled"`
|
|
|
|
BindAddress string `toml:"bind-address"`
|
|
|
|
AuthEnabled bool `toml:"auth-enabled"`
|
|
|
|
LogEnabled bool `toml:"log-enabled"`
|
|
|
|
WriteTracing bool `toml:"write-tracing"`
|
|
|
|
PprofEnabled bool `toml:"pprof-enabled"`
|
2015-10-29 21:49:37 +00:00
|
|
|
HTTPSEnabled bool `toml:"https-enabled"`
|
|
|
|
HTTPSCertificate string `toml:"https-certificate"`
|
2015-05-29 19:50:05 +00:00
|
|
|
}
|
|
|
|
|
2015-11-22 19:23:56 +00:00
|
|
|
// NewConfig returns a new Config with default settings.
|
2015-05-29 19:50:05 +00:00
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2015-07-17 23:54:06 +00:00
|
|
|
Enabled: true,
|
|
|
|
BindAddress: ":8086",
|
|
|
|
LogEnabled: true,
|
2015-10-29 21:49:37 +00:00
|
|
|
HTTPSEnabled: false,
|
|
|
|
HTTPSCertificate: "/etc/ssl/influxdb.pem",
|
2015-05-29 19:50:05 +00:00
|
|
|
}
|
|
|
|
}
|