summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go23
1 files changed, 4 insertions, 19 deletions
diff --git a/config.go b/config.go
index 452f187..15e234b 100644
--- a/config.go
+++ b/config.go
@@ -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