|
|
|
@ -58,6 +58,7 @@ type Conf struct { |
|
|
|
WriteTimeout time.Duration `yaml:"writeTimeout"` |
|
|
|
WriteTimeout time.Duration `yaml:"writeTimeout"` |
|
|
|
ReadBufferCount int `yaml:"readBufferCount"` |
|
|
|
ReadBufferCount int `yaml:"readBufferCount"` |
|
|
|
Metrics bool `yaml:"metrics"` |
|
|
|
Metrics bool `yaml:"metrics"` |
|
|
|
|
|
|
|
MetricsPort int `yaml:"metricsPort"` |
|
|
|
Pprof bool `yaml:"pprof"` |
|
|
|
Pprof bool `yaml:"pprof"` |
|
|
|
RunOnConnect string `yaml:"runOnConnect"` |
|
|
|
RunOnConnect string `yaml:"runOnConnect"` |
|
|
|
RunOnConnectRestart bool `yaml:"runOnConnectRestart"` |
|
|
|
RunOnConnectRestart bool `yaml:"runOnConnectRestart"` |
|
|
|
@ -137,6 +138,10 @@ func (conf *Conf) fillAndCheck() error { |
|
|
|
conf.ReadBufferCount = 512 |
|
|
|
conf.ReadBufferCount = 512 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if conf.MetricsPort == 0 { |
|
|
|
|
|
|
|
conf.MetricsPort = 9998 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(conf.Protocols) == 0 { |
|
|
|
if len(conf.Protocols) == 0 { |
|
|
|
conf.Protocols = []string{"udp", "tcp"} |
|
|
|
conf.Protocols = []string{"udp", "tcp"} |
|
|
|
} |
|
|
|
} |
|
|
|
|