From 18acdd7642507e2a34a3497492d4641d62b134b4 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Apr 2016 12:39:53 +0200 Subject: [PATCH] config influxdb host --- config_example.yml | 1 + models/config.go | 1 + stats_db.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config_example.yml b/config_example.yml index 509a25c..1b6db9d 100644 --- a/config_example.yml +++ b/config_example.yml @@ -17,6 +17,7 @@ nodes: aliases_path: /var/www/html/meshviewer/data/aliases.json influxdb: enable: false + host: http://localhost:8086 database: ffhb username: password: diff --git a/models/config.go b/models/config.go index 17c0e89..205f247 100644 --- a/models/config.go +++ b/models/config.go @@ -34,6 +34,7 @@ type Config struct { } `yaml:"nodes"` Influxdb struct { Enable bool `yaml:"enable"` + Addr string `yaml:"host"` Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` diff --git a/stats_db.go b/stats_db.go index ab889b4..fee5372 100644 --- a/stats_db.go +++ b/stats_db.go @@ -22,7 +22,7 @@ type StatsDb struct { func NewStatsDb() *StatsDb { // Make client c, err := client.NewHTTPClient(client.HTTPConfig{ - Addr: "http://localhost:8086", + Addr: config.Influxdb.Addr, Username: config.Influxdb.Username, Password: config.Influxdb.Password, })