aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/parse.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 20:53:35 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 20:53:35 +0200
commit6bd8a6c2cd153bad9ca044b409e55302e10206c1 (patch)
treeda1f175a7260a13fdfaa9a8817fc38351a480837 /internal/feed/parse.go
parent477241a2c2356c61b7317246040aee50d2a7a81d (diff)
downloadfeed2imap-go-6bd8a6c2cd153bad9ca044b409e55302e10206c1.tar.gz
feed2imap-go-6bd8a6c2cd153bad9ca044b409e55302e10206c1.tar.bz2
feed2imap-go-6bd8a6c2cd153bad9ca044b409e55302e10206c1.zip
Restructure
Diffstat (limited to '')
-rw-r--r--internal/feed/parse.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/feed/parse.go b/internal/feed/parse.go
index 435c0ed..dfb447a 100644
--- a/internal/feed/parse.go
+++ b/internal/feed/parse.go
@@ -41,7 +41,7 @@ func httpClient(disableTLS bool) *http.Client {
return stdHTTPClient
}
-func parseFeed(feed *Feed) error {
+func (feed *Feed) parse() error {
ctx, cancel := context(feed.Global.Timeout)
defer cancel()
@@ -54,9 +54,9 @@ func parseFeed(feed *Feed) error {
}
feed.feed = parsedFeed
- feed.items = make([]feeditem, len(parsedFeed.Items))
- for idx, item := range parsedFeed.Items {
- feed.items[idx] = feeditem{Feed: parsedFeed, Item: item, itemId: shortuuid.New()}
+ feed.items = make([]item, len(parsedFeed.Items))
+ for idx, feedItem := range parsedFeed.Items {
+ feed.items[idx] = item{Feed: parsedFeed, Item: feedItem, itemId: shortuuid.New(), feed: feed}
}
return nil
}
@@ -64,7 +64,7 @@ func parseFeed(feed *Feed) error {
func handleFeed(feed *Feed) {
log.Printf("Fetching %s from %s", feed.Name, feed.Url)
- err := parseFeed(feed)
+ err := feed.parse()
if err != nil {
if feed.cached.Failures() >= feed.Global.MaxFailures {
log.Error(err)
/+2 2020-05-08Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the las...René 'Necoro' Neumann2-7/+1 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12