forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
44 lines (34 loc) · 1.07 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package collectd
import (
"time"
"github.com/influxdb/influxdb/toml"
)
const (
DefaultBindAddress = ":25826"
DefaultDatabase = "collectd"
DefaultRetentionPolicy = ""
DefaultBatchSize = 5000
DefaultBatchDuration = toml.Duration(10 * time.Second)
DefaultTypesDB = "/usr/share/collectd/types.db"
)
// Config represents a configuration for the collectd service.
type Config struct {
Enabled bool `toml:"enabled"`
BindAddress string `toml:"bind-address"`
Database string `toml:"database"`
RetentionPolicy string `toml:"retention-policy"`
BatchSize int `toml:"batch-size"`
BatchDuration toml.Duration `toml:"batch-timeout"`
TypesDB string `toml:"typesdb"`
}
// NewConfig returns a new instance of Config with defaults.
func NewConfig() Config {
return Config{
BindAddress: DefaultBindAddress,
Database: DefaultDatabase,
RetentionPolicy: DefaultRetentionPolicy,
BatchSize: DefaultBatchSize,
BatchDuration: DefaultBatchDuration,
TypesDB: DefaultTypesDB,
}
}