Add a way to configure host
This commit is contained in:
@@ -15,6 +15,7 @@ type ConfigInterface interface {
|
||||
GetRefreshEverySeconds() int
|
||||
GetCacheTimeHours() int
|
||||
EnableRepair() bool
|
||||
GetHost() string
|
||||
GetPort() string
|
||||
GetDirectories() []string
|
||||
MeetsConditions(directory, torrentID, torrentName string, fileNames []string) bool
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user