switched to Twirp for RPC, server skaffold
This commit is contained in:
+33
-1
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user