aboutsummaryrefslogtreecommitdiff
path: root/internal/yaml/yaml.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 01:01:13 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 01:01:13 +0200
commit161dd4405474cc905e6912bab243509a3a6f88db (patch)
tree6648d425f4ab64325cb6419e619a88d9af61e5ec /internal/yaml/yaml.go
parent431a8ddb0c18b0781cba1d01eda3645b361f1b94 (diff)
downloadfeed2imap-go-161dd4405474cc905e6912bab243509a3a6f88db.tar.gz
feed2imap-go-161dd4405474cc905e6912bab243509a3a6f88db.tar.bz2
feed2imap-go-161dd4405474cc905e6912bab243509a3a6f88db.zip
GlobalOptions
Diffstat (limited to 'internal/yaml/yaml.go')
-rw-r--r--internal/yaml/yaml.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/yaml/yaml.go b/internal/yaml/yaml.go
index 8cbace7..3317f5d 100644
--- a/internal/yaml/yaml.go
+++ b/internal/yaml/yaml.go
@@ -11,8 +11,9 @@ import (
)
type config struct {
- GlobalConfig C.Map `yaml:",inline"`
- Feeds []configGroupFeed
+ C.GlobalOptions `yaml:",inline"`
+ GlobalConfig C.Map `yaml:",inline"`
+ Feeds []configGroupFeed
}
type group struct {
@@ -52,9 +53,10 @@ func (grpFeed *configGroupFeed) target() string {
}
func parse(buf []byte) (config, error) {
- var parsedCfg config
+ parsedCfg := config{GlobalOptions: C.DefaultGlobalOptions}
+
if err := yaml.Unmarshal(buf, &parsedCfg); err != nil {
- return parsedCfg, fmt.Errorf("while unmarshalling: %w", err)
+ return config{}, fmt.Errorf("while unmarshalling: %w", err)
}
//fmt.Printf("--- parsedCfg:\n%+v\n\n", parsedCfg)
tr> 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1