2015-10-19 21:35:48 +00:00
|
|
|
package registration
|
|
|
|
|
2015-10-19 22:16:33 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/influxdb/influxdb/toml"
|
|
|
|
)
|
2015-10-19 21:35:48 +00:00
|
|
|
|
|
|
|
const (
|
2015-11-16 21:43:25 +00:00
|
|
|
defaultURL = "https://enterprise.influxdata.com"
|
|
|
|
defaultStatsInterval = time.Minute
|
2015-10-19 21:35:48 +00:00
|
|
|
)
|
|
|
|
|
2015-11-16 21:43:25 +00:00
|
|
|
// Config represents the configuration for the registration service.
|
2015-10-19 21:35:48 +00:00
|
|
|
type Config struct {
|
2015-10-19 22:16:33 +00:00
|
|
|
Enabled bool `toml:"enabled"`
|
|
|
|
URL string `toml:"url"`
|
|
|
|
Token string `toml:"token"`
|
|
|
|
StatsInterval toml.Duration `toml:"stats-interval"`
|
2015-10-19 21:35:48 +00:00
|
|
|
}
|
|
|
|
|
2015-11-16 21:43:25 +00:00
|
|
|
// NewConfig returns an instance of Config with defaults.
|
2015-10-19 21:35:48 +00:00
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2015-10-19 22:16:33 +00:00
|
|
|
Enabled: true,
|
2015-11-16 21:43:25 +00:00
|
|
|
URL: defaultURL,
|
|
|
|
StatsInterval: toml.Duration(defaultStatsInterval),
|
2015-10-19 21:35:48 +00:00
|
|
|
}
|
|
|
|
}
|