4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 08:49:24 +00:00

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
This commit is contained in:
Wim
2019-09-09 23:48:00 +02:00
committed by GitHub
parent f92927eae5
commit 28783a4146
4 changed files with 38 additions and 1 deletions

View File

@ -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()