80 lines
1.5 KiB
Go
80 lines
1.5 KiB
Go
package config
|
|
|
|
type serverConfig struct {
|
|
Host string `json:"host" yaml:"host"`
|
|
Port int `json:"port" yaml:"port"`
|
|
Grid int `json:"grid" yaml:"grid"` // TODO no use
|
|
Zone int `json:"zone" yaml:"zone"` // TODO no use
|
|
Station int `json:"station" yaml:"station"` // TODO no use
|
|
}
|
|
|
|
func (config *serverConfig) GetHost() string {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
return config.Host
|
|
}
|
|
|
|
func (config *serverConfig) SetHost(host string) {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
config.Host = host
|
|
}
|
|
|
|
func (config *serverConfig) GetPort() int {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
return config.Port
|
|
}
|
|
|
|
func (config *serverConfig) SetPort(port int) {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
config.Port = port
|
|
}
|
|
|
|
func (config *serverConfig) GetGrid() int {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
return config.Grid
|
|
}
|
|
|
|
func (config *serverConfig) SetGrid(grid int) {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
config.Grid = grid
|
|
}
|
|
|
|
func (config *serverConfig) GetZone() int {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
return config.Zone
|
|
}
|
|
|
|
func (config *serverConfig) SetZone(zone int) {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
config.Zone = zone
|
|
}
|
|
|
|
func (config *serverConfig) GetStation() int {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
return config.Station
|
|
}
|
|
|
|
func (config *serverConfig) SetStation(station int) {
|
|
if config == nil {
|
|
panic("server config is nil")
|
|
}
|
|
config.Station = station
|
|
}
|