redis based router & roomstore
This commit is contained in:
+11
-2
@@ -6,8 +6,9 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Port uint32 `yaml:"port"`
|
||||
RTC RTCConfig `yaml:"rtc"`
|
||||
Port uint32 `yaml:"port"`
|
||||
RTC RTCConfig `yaml:"rtc"`
|
||||
Redis RedisConfig `yaml:"redis"`
|
||||
|
||||
// multi-node configuration,
|
||||
MultiNode bool `yaml:"multi_node"`
|
||||
@@ -24,6 +25,11 @@ type RTCConfig struct {
|
||||
MaxBufferTime int `yaml:"max_buffer_time"`
|
||||
}
|
||||
|
||||
type RedisConfig struct {
|
||||
Address string `yaml:"address"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
|
||||
func NewConfig(confString string) (*Config, error) {
|
||||
// start with defaults
|
||||
conf := &Config{
|
||||
@@ -35,6 +41,9 @@ func NewConfig(confString string) (*Config, error) {
|
||||
"stun.l.google.com:19302",
|
||||
},
|
||||
},
|
||||
Redis: RedisConfig{
|
||||
Address: "localhost:6379",
|
||||
},
|
||||
}
|
||||
if confString != "" {
|
||||
yaml.Unmarshal([]byte(confString), conf)
|
||||
|
||||
Reference in New Issue
Block a user