Small refactor (#148)
* small refactor * extra line * fix room allocator test * selector fakes not used * keep decisions out of router * put nodeId logic back * fix room allocator test
This commit is contained in:
+11
-9
@@ -10,8 +10,6 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/urfave/cli/v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing/selector"
|
||||
)
|
||||
|
||||
var DefaultStunServers = []string{
|
||||
@@ -112,9 +110,17 @@ type WebHookConfig struct {
|
||||
}
|
||||
|
||||
type NodeSelectorConfig struct {
|
||||
Kind string `yaml:"kind"`
|
||||
SysloadLimit float32 `yaml:"sysload_limit"`
|
||||
Regions []selector.RegionConfig `yaml:"regions"`
|
||||
Kind string `yaml:"kind"`
|
||||
SysloadLimit float32 `yaml:"sysload_limit"`
|
||||
Regions []RegionConfig `yaml:"regions"`
|
||||
}
|
||||
|
||||
// RegionConfig lists available regions and their latitude/longitude, so the selector would prefer
|
||||
// regions that are closer
|
||||
type RegionConfig struct {
|
||||
Name string `yaml:"name"`
|
||||
Lat float64 `yaml:"lat"`
|
||||
Lon float64 `yaml:"lon"`
|
||||
}
|
||||
|
||||
func NewConfig(confString string, c *cli.Context) (*Config, error) {
|
||||
@@ -255,7 +261,3 @@ func (conf *Config) unmarshalKeys(keys string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetAudioConfig(conf *Config) AudioConfig {
|
||||
return conf.Audio
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user