switched to Twirp for RPC, server skaffold

This commit is contained in:
David Zhao
2020-10-06 23:20:44 -07:00
parent 5117b8bf80
commit 0d6c0adbdd
20 changed files with 2875 additions and 706 deletions
+33 -1
View File
@@ -1,5 +1,37 @@
package config
type Config struct {
import (
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v2"
)
type Config struct {
APIPort uint32 `yaml:"api_port"`
RTCPort uint32 `yaml:"rtc_port"`
UDPRangeStart uint32 `yaml:"udp_range_start"`
UDPRangeEnd uint32 `yaml:"udp_range_end"`
// multi-node configuration,
MultiNode bool `yaml:"multi_node"`
Development bool `yaml:"development"`
}
func NewConfig(confString string) (*Config, error) {
// start with defaults
conf := &Config{
APIPort: 7880,
RTCPort: 7881,
UDPRangeStart: 10000,
UDPRangeEnd: 11000,
}
if confString != "" {
yaml.Unmarshal([]byte(confString), conf)
}
return conf, nil
}
func (conf *Config) UpdateFromCLI(c *cli.Context) {
if c.IsSet("dev") {
conf.Development = c.Bool("dev")
}
}