aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/cache_v1.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-08 00:03:14 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-08 00:03:14 +0200
commit12e4af7b3b73cbcbbd2f0adfea456db540743cf2 (patch)
tree23aa59cbeb1983f42c3ea440e3aa62bff1d8a5cd /internal/feed/cache_v1.go
parent0532548c8abf170aaf0abddab67561d2c499863a (diff)
downloadfeed2imap-go-12e4af7b3b73cbcbbd2f0adfea456db540743cf2.tar.gz
feed2imap-go-12e4af7b3b73cbcbbd2f0adfea456db540743cf2.tar.bz2
feed2imap-go-12e4af7b3b73cbcbbd2f0adfea456db540743cf2.zip
Print item hashes in debug mode
Diffstat (limited to 'internal/feed/cache_v1.go')
-rw-r--r--internal/feed/cache_v1.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/feed/cache_v1.go b/internal/feed/cache_v1.go
index d515528..157741f 100644
--- a/internal/feed/cache_v1.go
+++ b/internal/feed/cache_v1.go
@@ -2,6 +2,7 @@ package feed
import (
"crypto/sha256"
+ "encoding/hex"
"fmt"
"strconv"
"time"
@@ -40,6 +41,10 @@ type cachedFeed struct {
type itemHash [sha256.Size]byte
+func (h itemHash) String() string {
+ return hex.EncodeToString(h[:])
+}
+
type cachedItem struct {
Guid string
Title string
@@ -56,7 +61,8 @@ func (item cachedItem) String() string {
Guid: %q
Link: %q
Date: %s
-}`, item.Title, item.Guid, item.Link, util.TimeFormat(item.Date))
+ Hash: %s
+}`, item.Title, item.Guid, item.Link, util.TimeFormat(item.Date), item.Hash)
}
func (cf *cachedFeed) Checked(withFailure bool) {
9d5fca0ee32d8e5624fb444881efa&follow=1'>Fix update in IMAPRené 'Necoro' Neumann1-2/+12 2020-05-03Update support for IMAPRené 'Necoro' Neumann5-17/+205 2020-05-03Option "reupload-if-updated"René 'Necoro' Neumann2-0/+4 2020-05-03Fix typoRené 'Necoro' Neumann1-2/+2 2020-05-02Use uuid library directly and encode to base64.René 'Necoro' Neumann6-10/+16 2020-05-02RestructureRené 'Necoro' Neumann8-95/+111 2020-05-02WIP: Message-IdsRené 'Necoro' Neumann8-5/+40 2020-05-02Typo and mention config example in READMERené 'Necoro' Neumann2-1/+3