aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/yaml.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-01 18:27:23 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-01 18:27:23 +0200
commit9990266256b8859b3d500ff0fc0fcee6e1e64193 (patch)
tree558148ac5dfa9a49975fe0de2c14a9cfd0725e53 /pkg/config/yaml.go
parent9bd0c60e5007dc30808b7eef17a091fb248d54d6 (diff)
downloadfeed2imap-go-9990266256b8859b3d500ff0fc0fcee6e1e64193.tar.gz
feed2imap-go-9990266256b8859b3d500ff0fc0fcee6e1e64193.tar.bz2
feed2imap-go-9990266256b8859b3d500ff0fc0fcee6e1e64193.zip
Reintroduce yaml-internal `feed`
Diffstat (limited to '')
-rw-r--r--pkg/config/yaml.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/pkg/config/yaml.go b/pkg/config/yaml.go
index 1afba0a..66f099a 100644
--- a/pkg/config/yaml.go
+++ b/pkg/config/yaml.go
@@ -29,9 +29,14 @@ type group struct {
Feeds []configGroupFeed
}
+type feed struct {
+ Name string
+ Url string
+}
+
type configGroupFeed struct {
Target yaml.Node
- Feed Feed `yaml:",inline"`
+ Feed feed `yaml:",inline"`
Group group `yaml:",inline"`
Options Map `yaml:",inline"`
}
@@ -187,7 +192,6 @@ func buildFeeds(cfg []configGroupFeed, target []string, feeds Feeds, globalFeedO
return fmt.Errorf("Entry with targetStr %s is both a Feed and a group", target)
case f.isFeed():
- feedCopy := f.Feed
name := f.Feed.Name
if name == "" {
return fmt.Errorf("Unnamed feed")
@@ -204,9 +208,12 @@ func buildFeeds(cfg []configGroupFeed, target []string, feeds Feeds, globalFeedO
}
}
- feedCopy.Options = opt
- feedCopy.Target = target
- feeds[name] = &feedCopy
+ feeds[name] = &Feed{
+ Name: name,
+ Url: f.Feed.Url,
+ Options: opt,
+ Target: target,
+ }
case f.isGroup():
if err := buildFeeds(f.Group.Feeds, target, feeds, globalFeedOptions); err != nil {