Allow configuring hosts

This commit is contained in:
Ben Sarmiento
2023-11-07 14:14:33 +01:00
parent 1349de7d3f
commit 3cc5044bc5
5 changed files with 19 additions and 64 deletions

View File

@@ -3,6 +3,7 @@ package config
type ZurgConfig struct {
Version string `yaml:"zurg"`
Token string `yaml:"token"`
Host string `yaml:"host"`
Port string `yaml:"port"`
NumOfWorkers int `yaml:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
@@ -17,6 +18,13 @@ func (z *ZurgConfig) GetToken() string {
return z.Token
}
func (z *ZurgConfig) GetHost() string {
if z.Host == "" {
return "[::]"
}
return z.Host
}
func (z *ZurgConfig) GetPort() string {
if z.Port == "" {
return "9999"