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-10-19 22:16:33 +00:00
|
|
|
DefaultURL = "https://enterprise.influxdata.com"
|
|
|
|
DefaultStatsInterval = time.Minute
|
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
|
|
|
}
|
|
|
|
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2015-10-19 22:16:33 +00:00
|
|
|
Enabled: true,
|
|
|
|
URL: DefaultURL,
|
|
|
|
StatsInterval: toml.Duration(DefaultStatsInterval),
|
2015-10-19 21:35:48 +00:00
|
|
|
}
|
|
|
|
}
|