diff options
author | Wim <wim@42.be> | 2019-09-09 23:48:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 23:48:00 +0200 |
commit | 28783a4146361381e57419aa4bcf623f7ab7b80d (patch) | |
tree | c796df65d6b02e7151c4d4c7b6714b99df676171 /bridge | |
parent | f92927eae5b460e768f6cf5fb97e237640dfbd44 (diff) | |
download | matterbridge-msglm-28783a4146361381e57419aa4bcf623f7ab7b80d.tar.gz matterbridge-msglm-28783a4146361381e57419aa4bcf623f7ab7b80d.tar.bz2 matterbridge-msglm-28783a4146361381e57419aa4bcf623f7ab7b80d.zip |
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
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/config/config.go | 5 |
1 files changed, 5 insertions, 0 deletions
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() |