From 28783a4146361381e57419aa4bcf623f7ab7b80d Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 9 Sep 2019 23:48:00 +0200 Subject: Do configuration validation on start-up. Fixes #888 (#889) Fail if: * we don't have any gateways configured * we have gateways configured but with non-existing bridge configuration * we have gateways configured without any configuration --- bridge/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge') diff --git a/bridge/config/config.go b/bridge/config/config.go index cf6872a0..5da535dc 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -206,6 +206,7 @@ type BridgeValues struct { } type Config interface { + Viper() *viper.Viper BridgeValues() *BridgeValues GetBool(key string) (bool, bool) GetInt(key string) (int, bool) @@ -274,6 +275,10 @@ func (c *config) BridgeValues() *BridgeValues { return c.cv } +func (c *config) Viper() *viper.Viper { + return c.v +} + func (c *config) GetBool(key string) (bool, bool) { c.RLock() defer c.RUnlock() -- cgit v1.2.3