diff --git a/common/config.go b/common/config.go index f39eaa0..afc5852 100644 --- a/common/config.go +++ b/common/config.go @@ -102,10 +102,10 @@ func checkConfig() error { if Config.TimeoutToFail < Config.RetryInterval { return errors.New("TimeoutToFail should not be less than RetryInterval") } - if Config.Store.Driver == BoltDb { + switch Config.Store.Driver { + case BoltDb: return nil - } - if Config.Store.Driver == Mysql { + case Mysql: if Config.Store.Host == "" { return errors.New("Db host not valid ") } @@ -115,6 +115,13 @@ func checkConfig() error { if Config.Store.User == "" { return errors.New("Db user not valid ") } + case Redis: + if Config.Store.Host == "" { + return errors.New("Redis host not valid ") + } + if Config.Store.Port == 0 { + return errors.New("Redis port not valid ") + } } return nil }