From dd8143979533f317da76b3e6a12b3f22ec237067 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 11 May 2018 19:27:33 +0900 Subject: [PATCH] ing --- config/external/external.go | 7 ++++--- config/external/influxdb.go | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 config/external/influxdb.go diff --git a/config/external/external.go b/config/external/external.go index 79ca44c..e423552 100644 --- a/config/external/external.go +++ b/config/external/external.go @@ -1,7 +1,8 @@ package external type External struct { - GRPC *GRPC `json:"grpc,omitempty"` - Kafka *Kafka `json:"kafka,omitempty"` - Redis *Redis `json:"redis,omitempty"` + GRPC *GRPC `json:"grpc,omitempty"` + Kafka *Kafka `json:"kafka,omitempty"` + Redis *Redis `json:"redis,omitempty"` + InfluxDB *InfluxDB `json:"influxDB,omitempty"` } diff --git a/config/external/influxdb.go b/config/external/influxdb.go new file mode 100644 index 0000000..cdf657d --- /dev/null +++ b/config/external/influxdb.go @@ -0,0 +1,23 @@ +package external + +import "time" + +type InfluxDB struct { + HTTPConfigs map[string]*InfluxDBHTTPConfig `json:"httpConfigs" yaml:"httpConfigs" toml:"httpConfigs"` + BatchPointsConfigs map[string]*InfluxDBBatchPointsConfig `json:"batchPointsConfigs" yaml:"batchPointsConfigs" toml:"batchPointsConfigs"` +} + +type InfluxDBHTTPConfig struct { + Address string `json:"address" yaml:"address" toml:"address"` + Username string `json:"username" yaml:"username" toml:"username"` + Password string `json:"password" yaml:"password" toml:"password"` + UserAgent string `json:"userAgent" yaml:"userAgent" toml:"userAgent"` + Timeout time.Duration `json:"timeout" yaml:"timeout" toml:"timeout"` +} + +type InfluxDBBatchPointsConfig struct { + Precision string `json:"precision" yaml:"precision" toml:"precision"` + Database string `json:"database" yaml:"database" toml:"database"` + RetentionPolicy string `json:"retentionPolicy" yaml:"retentionPolicy" toml:"retentionPolicy"` + WriteConsistency string `json:"writeConsistency" yaml:"writeConsistency" toml:"writeConsistency"` +}