Add new configs
This commit is contained in:
@@ -10,6 +10,9 @@ import (
|
||||
type ConfigInterface interface {
|
||||
GetVersion() string
|
||||
GetToken() string
|
||||
GetNumOfWorkers() int
|
||||
GetRefreshEverySeconds() int
|
||||
GetCacheTimeHours() int
|
||||
GetPort() string
|
||||
GetDirectories() []string
|
||||
MeetsConditions(directory, fileID, fileName string) bool
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package config
|
||||
|
||||
type ZurgConfig struct {
|
||||
Version string `yaml:"zurg"`
|
||||
Token string `yaml:"token"`
|
||||
Port string `yaml:"port"`
|
||||
Version string `yaml:"zurg"`
|
||||
Token string `yaml:"token"`
|
||||
Port string `yaml:"port"`
|
||||
NumOfWorkers int `yaml:"concurrent_workers"`
|
||||
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
|
||||
CacheTimeHours int `yaml:"info_cache_time_hours"`
|
||||
}
|
||||
|
||||
@@ -28,6 +28,18 @@ func (z *ZurgConfigV1) GetPort() string {
|
||||
return z.Port
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetNumOfWorkers() int {
|
||||
return z.NumOfWorkers
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetRefreshEverySeconds() int {
|
||||
return z.RefreshEverySeconds
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetCacheTimeHours() int {
|
||||
return z.CacheTimeHours
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetDirectories() []string {
|
||||
var rootDirectories []string
|
||||
for directory := range z.Directories {
|
||||
|
||||
Reference in New Issue
Block a user