support for redis db

This commit is contained in:
David Zhao
2021-04-30 15:03:41 -07:00
parent e1f23e6dbe
commit 7877bc6ecd
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -186,6 +186,7 @@ func createRouterAndStore(config *config.Config, node routing.LocalNode) (router
Addr: config.Redis.Address, Addr: config.Redis.Address,
Username: config.Redis.Username, Username: config.Redis.Username,
Password: config.Redis.Password, Password: config.Redis.Password,
DB: config.Redis.DB,
}) })
if err = rc.Ping(context.Background()).Err(); err != nil { if err = rc.Ping(context.Background()).Err(); err != nil {
err = errors.Wrap(err, "unable to connect to redis") err = errors.Wrap(err, "unable to connect to redis")
+1
View File
@@ -52,6 +52,7 @@ type RedisConfig struct {
Address string `yaml:"address"` Address string `yaml:"address"`
Username string `yaml:"username"` Username string `yaml:"username"`
Password string `yaml:"password"` Password string `yaml:"password"`
DB int `yaml:"db"`
} }
type TURNConfig struct { type TURNConfig struct {