influxdb/services/registration/config.go

30 lines
676 B
Go
Raw Normal View History

package registration
2015-10-19 22:16:33 +00:00
import (
"time"
"github.com/influxdb/influxdb/toml"
)
const (
defaultURL = "https://enterprise.influxdata.com"
defaultStatsInterval = time.Minute
)
// Config represents the configuration for the registration service.
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"`
}
// NewConfig returns an instance of Config with defaults.
func NewConfig() Config {
return Config{
2015-10-19 22:16:33 +00:00
Enabled: true,
URL: defaultURL,
StatsInterval: toml.Duration(defaultStatsInterval),
}
}