diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-12 08:53:12 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-12 08:53:12 +0100 |
commit | b3ca09586c23831d9f089ab8a023580c403f8e55 (patch) | |
tree | 60bd13a7efe3a2ea210890fb9b486d6d68a90409 /config.go | |
parent | 32b09256150d139e77d04533f28d0c26a32b12bd (diff) |
reorganised types and modules
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -10,33 +10,18 @@ import ( "os" ) -type SCORSHWorker_cfg struct { - Name string `yaml:"w_name"` - Repos []string `yaml:"w_repos"` - Folder string `yaml:"w_folder"` - Logfile string `yaml:"w_logfile"` - Tagfile string `yaml:"w_tagfile"` - Keyrings []string `yaml:"w_keyrings"` -} - -type SCORSHcfg struct { - Spooldir string `yaml:"s_spooldir"` - Logfile string `yaml:"s_logfile"` - LogPrefix string `yaml:"s_logprefix"` - Workers []SCORSHWorker_cfg `yaml:"s_workers"` -} // Read a configuration from fname or die -func ReadGlobalConfig(fname string) *SCORSHcfg { +func ReadGlobalConfig(fname string) *SCORSHmaster { data, err := ioutil.ReadFile(fname) if err != nil { log.Fatal("Error while reading file: ", err) } - var cfg *SCORSHcfg - cfg = new(SCORSHcfg) + var cfg *SCORSHmaster + cfg = new(SCORSHmaster) // Unmarshal the YAML configuration file into a SCORSHcfg structure err = yaml.Unmarshal(data, cfg) @@ -73,7 +58,7 @@ func ReadGlobalConfig(fname string) *SCORSHcfg { } -func (cfg *SCORSHcfg) String() string { +func (cfg *SCORSHmaster_cfg) String() string { var buff bytes.Buffer |