26 lines
444 B
Go
26 lines
444 B
Go
package net
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
ErrUnableToConnect = errors.New("unable to connect")
|
|
)
|
|
|
|
type ConfigGetter interface {
|
|
GetNet() Config
|
|
}
|
|
|
|
type Config struct {
|
|
Server ServerConfig `yaml:"server"`
|
|
Stream StreamConfig `yaml:"stream"`
|
|
}
|
|
|
|
type ServerConfig struct {
|
|
ListenAddrs []string `yaml:"listenAddrs"`
|
|
}
|
|
|
|
type StreamConfig struct {
|
|
TimeoutMilliseconds int `yaml:"timeoutMilliseconds"`
|
|
MaxMsgSizeMb int `yaml:"maxMsgSizeMb"`
|
|
}
|