You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
309 B
Go
25 lines
309 B
Go
3 years ago
|
package config
|
||
|
|
||
|
type ListenConfig struct {
|
||
|
Host string
|
||
|
Port int
|
||
|
}
|
||
|
type Config struct {
|
||
|
Listen ListenConfig
|
||
|
}
|
||
|
|
||
|
var conf *Config = DefaultConfig()
|
||
|
|
||
|
func GetConfig() *Config {
|
||
|
return conf
|
||
|
}
|
||
|
|
||
|
func DefaultConfig() *Config {
|
||
|
return &Config{
|
||
|
Listen: ListenConfig{
|
||
|
Host: "0.0.0.0",
|
||
|
Port: 8080,
|
||
|
},
|
||
|
}
|
||
|
}
|