From 3ceaacbd57722787526efe1d082fe682c6debffb Mon Sep 17 00:00:00 2001 From: Mirko Teodorovic Date: Wed, 15 Jan 2020 17:02:18 +0100 Subject: [PATCH] NOISSUE - add nats_url in bootstrap config (#13) * add nats_url in bootstrap config Signed-off-by: Mirko Teodorovic * add nats_url in bootstrap config Signed-off-by: Mirko Teodorovic --- internal/pkg/bootstrap/bootstrap.go | 7 ++++++- internal/pkg/config/config.go | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/pkg/bootstrap/bootstrap.go b/internal/pkg/bootstrap/bootstrap.go index 3a105be7..4841bb71 100644 --- a/internal/pkg/bootstrap/bootstrap.go +++ b/internal/pkg/bootstrap/bootstrap.go @@ -40,6 +40,7 @@ type infraConfig struct { HTTPPort string `json:"http_port"` MqttURL string `json:"mqtt_url"` EdgexURL string `json:"edgex_url"` + NatsURL string `json:"nats_url"` } // Bootstrap - Retrieve device config @@ -91,7 +92,11 @@ func Bootstrap(cfg Config, logger log.Logger, file string) error { dataChan = dc.MainfluxChannels[0].ID } - sc := config.ServerConf{Port: ic.HTTPPort} + sc := config.ServerConf{ + Port: ic.HTTPPort, + NatsURL: ic.NatsURL, + } + tc := config.ThingConf{ ID: dc.MainfluxID, Key: dc.MainfluxKey, diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 2ac97dfd..562c73bd 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -11,7 +11,8 @@ import ( ) type ServerConf struct { - Port string `toml:"port"` + Port string `toml:"port"` + NatsURL string `toml:"nats_url"` } type ThingConf struct {