influxdb/storage/config.go

32 lines
789 B
Go
Raw Permalink Normal View History

2018-10-02 15:06:37 +00:00
package storage
import (
"time"
2020-08-26 17:46:47 +00:00
"github.com/influxdata/influxdb/v2/tsdb"
"github.com/influxdata/influxdb/v2/v1/services/precreator"
"github.com/influxdata/influxdb/v2/v1/services/retention"
2018-10-09 18:43:10 +00:00
)
2018-10-02 15:06:37 +00:00
// DefaultWriteTimeout is the default timeout for a complete write to succeed.
const DefaultWriteTimeout = 10 * time.Second
2018-10-02 15:06:37 +00:00
// Config holds the configuration for an Engine.
type Config struct {
Data tsdb.Config
WriteTimeout time.Duration
2020-04-24 16:47:22 +00:00
RetentionService retention.Config
PrecreatorConfig precreator.Config
2018-10-03 18:34:34 +00:00
}
// NewConfig initialises a new config for an Engine.
func NewConfig() Config {
return Config{
Data: tsdb.NewConfig(),
WriteTimeout: DefaultWriteTimeout,
RetentionService: retention.NewConfig(),
PrecreatorConfig: precreator.NewConfig(),
}
}