influxdb/storage/config.go

34 lines
770 B
Go
Raw Normal View History

2018-10-02 15:06:37 +00:00
package storage
import (
"time"
"github.com/influxdata/influxdb/v2/toml"
2020-08-26 17:46:47 +00:00
"github.com/influxdata/influxdb/v2/tsdb"
2018-10-02 15:06:37 +00:00
)
// Default configuration values.
2018-10-09 18:43:10 +00:00
const (
2019-03-06 17:48:57 +00:00
DefaultRetentionInterval = time.Hour
DefaultSeriesFileDirectoryName = "_series"
DefaultIndexDirectoryName = "index"
DefaultWALDirectoryName = "wal"
DefaultEngineDirectoryName = "data"
2018-10-09 18:43:10 +00:00
)
2018-10-02 15:06:37 +00:00
// Config holds the configuration for an Engine.
type Config struct {
Data tsdb.Config
2020-04-24 16:47:22 +00:00
// Frequency of retention in seconds.
RetentionInterval toml.Duration `toml:"retention-interval"`
2018-10-03 18:34:34 +00:00
}
// NewConfig initialises a new config for an Engine.
func NewConfig() Config {
return Config{
Data: tsdb.NewConfig(),
2019-03-06 17:48:57 +00:00
RetentionInterval: toml.Duration(DefaultRetentionInterval),
}
}