Skip to content

Commit

Permalink
NOISSUE - add nats_url in bootstrap config (#13)
Browse files Browse the repository at this point in the history
* add nats_url in bootstrap config

Signed-off-by: Mirko Teodorovic <[email protected]>

* add nats_url in bootstrap config

Signed-off-by: Mirko Teodorovic <[email protected]>
  • Loading branch information
mteodor authored and manuio committed Jan 15, 2020
1 parent 7115650 commit 3ceaacb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion internal/pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
)

type ServerConf struct {
Port string `toml:"port"`
Port string `toml:"port"`
NatsURL string `toml:"nats_url"`
}

type ThingConf struct {
Expand Down

0 comments on commit 3ceaacb

Please sign in to comment.