예제 #1
0
파일: config.go 프로젝트: hawson/influxdb
// InitTableAttrs initialises all ARRAY attributes if empty
func (c *Config) InitTableAttrs() {
	if len(c.UDPs) == 0 {
		c.UDPs = []udp.Config{udp.NewConfig()}
	}
	if len(c.Graphites) == 0 {
		c.Graphites = []graphite.Config{graphite.NewConfig()}
	}
}
예제 #2
0
파일: config.go 프로젝트: li-ang/influxdb
// NewConfig returns an instance of Config with reasonable defaults.
func NewConfig() *Config {
	c := &Config{}
	c.Meta = meta.NewConfig()
	c.Data = tsdb.NewConfig()
	c.Coordinator = coordinator.NewConfig()
	c.Precreator = precreator.NewConfig()

	c.Admin = admin.NewConfig()
	c.Monitor = monitor.NewConfig()
	c.Subscriber = subscriber.NewConfig()
	c.HTTPD = httpd.NewConfig()

	c.GraphiteInputs = []graphite.Config{graphite.NewConfig()}
	c.CollectdInputs = []collectd.Config{collectd.NewConfig()}
	c.OpenTSDBInputs = []opentsdb.Config{opentsdb.NewConfig()}
	c.UDPInputs = []udp.Config{udp.NewConfig()}

	c.ContinuousQuery = continuous_querier.NewConfig()
	c.Retention = retention.NewConfig()
	c.BindAddress = DefaultBindAddress

	return c
}