// NewConfig returns an instance of Config with reasonable defaults. func NewConfig() *Config { c := &Config{} c.Meta = meta.NewConfig() c.Data = tsdb.NewConfig() c.Cluster = cluster.NewConfig() c.Precreator = precreator.NewConfig() c.Admin = admin.NewConfig() c.Monitor = monitor.NewConfig() c.Subscriber = subscriber.NewConfig() c.HTTPD = httpd.NewConfig() c.Collectd = collectd.NewConfig() c.OpenTSDB = opentsdb.NewConfig() c.ContinuousQuery = continuous_querier.NewConfig() c.Retention = retention.NewConfig() c.HintedHandoff = hh.NewConfig() c.BindAddress = DefaultBindAddress // All ARRAY attributes have to be init after toml decode // See: https://github.com/BurntSushi/toml/pull/68 // Those attributes will be initialized in Config.InitTableAttrs method // Concerned Attributes: // * `c.Graphites` // * `c.UDPs` return c }
// NewHandler returns a new instance of Handler. func NewHandler(requireAuthentication bool) *Handler { config := httpd.NewConfig() config.AuthEnabled = requireAuthentication config.SharedSecret = "super secret key" h := &Handler{ Handler: httpd.NewHandler(config), } h.Handler.MetaClient = &h.MetaClient h.Handler.QueryExecutor = influxql.NewQueryExecutor() h.Handler.QueryExecutor.StatementExecutor = &h.StatementExecutor h.Handler.QueryAuthorizer = &h.QueryAuthorizer h.Handler.Version = "0.0.0" return h }
// NewConfig returns an instance of Config with reasonable defaults. func NewConfig() *Config { c := &Config{} c.Meta = meta.NewConfig() c.Data = tsdb.NewConfig() c.Cluster = cluster.NewConfig() c.Precreator = precreator.NewConfig() c.Admin = admin.NewConfig() c.Monitor = monitor.NewConfig() c.Subscriber = subscriber.NewConfig() c.HTTPD = httpd.NewConfig() c.Collectd = collectd.NewConfig() c.OpenTSDB = opentsdb.NewConfig() c.ContinuousQuery = continuous_querier.NewConfig() c.Retention = retention.NewConfig() c.HintedHandoff = hh.NewConfig() c.BindAddress = DefaultBindAddress return c }
// 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 }