aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/feed.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-25 17:00:57 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-25 17:00:57 +0200
commit573ce1982da2e754947453fdaf0d50204873acb4 (patch)
treef6528235dce77db514ce4442ee8817e993fdcc86 /pkg/config/feed.go
parentd21881150c09986571a563eaf30bc1687787e63f (diff)
downloadfeed2imap-go-573ce1982da2e754947453fdaf0d50204873acb4.tar.gz
feed2imap-go-573ce1982da2e754947453fdaf0d50204873acb4.tar.bz2
feed2imap-go-573ce1982da2e754947453fdaf0d50204873acb4.zip
Larger restructuring
Diffstat (limited to '')
-rw-r--r--pkg/config/feed.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkg/config/feed.go b/pkg/config/feed.go
new file mode 100644
index 0000000..03494d3
--- /dev/null
+++ b/pkg/config/feed.go
@@ -0,0 +1,38 @@
+package config
+
+import (
+ "fmt"
+ "strings"
+)
+
+// One stored feed
+type Feed struct {
+ Name string
+ Target []string `yaml:"-"`
+ Url string
+ Options `yaml:",inline"`
+}
+
+// Convenience type for all feeds
+type Feeds map[string]Feed
+
+func (feeds Feeds) String() string {
+ var b strings.Builder
+ app := func(a ...interface{}) {
+ _, _ = fmt.Fprint(&b, a...)
+ }
+ app("Feeds [")
+
+ first := true
+ for k, v := range feeds {
+ if !first {
+ app(", ")
+ }
+ app(`"`, k, `"`, ": ")
+ _, _ = fmt.Fprintf(&b, "%+v", v)
+ first = false
+ }
+ app("]")
+
+ return b.String()
+}
mantics of `n` resultRené 'Necoro' Neumann2-9/+15 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. This...René 'Necoro' Neumann2-2/+66 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0