summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-12 08:53:12 +0100
committerKatolaZ <katolaz@freaknet.org>2017-07-12 08:53:12 +0100
commitb3ca09586c23831d9f089ab8a023580c403f8e55 (patch)
tree60bd13a7efe3a2ea210890fb9b486d6d68a90409 /config.go
parent32b09256150d139e77d04533f28d0c26a32b12bd (diff)
reorganised types and modules
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