diff options
Diffstat (limited to 'reader')
-rw-r--r-- | reader/atom/atom.go | 4 | ||||
-rw-r--r-- | reader/feed/handler.go | 6 | ||||
-rw-r--r-- | reader/feed/parser.go | 6 | ||||
-rw-r--r-- | reader/icon/finder.go | 6 | ||||
-rw-r--r-- | reader/json/json.go | 4 | ||||
-rw-r--r-- | reader/rdf/rdf.go | 4 | ||||
-rw-r--r-- | reader/rss/rss.go | 4 | ||||
-rw-r--r-- | reader/subscription/finder.go | 4 |
8 files changed, 19 insertions, 19 deletions
diff --git a/reader/atom/atom.go b/reader/atom/atom.go index 61844a5..68a3903 100644 --- a/reader/atom/atom.go +++ b/reader/atom/atom.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/miniflux/miniflux/helper" + "github.com/miniflux/miniflux/crypto" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/date" @@ -163,7 +163,7 @@ func getContent(a *atomEntry) string { func getHash(a *atomEntry) string { for _, value := range []string{a.ID, getURL(a.Links)} { if value != "" { - return helper.Hash(value) + return crypto.Hash(value) } } diff --git a/reader/feed/handler.go b/reader/feed/handler.go index e804e29..83cbc6f 100644 --- a/reader/feed/handler.go +++ b/reader/feed/handler.go @@ -9,13 +9,13 @@ import ( "time" "github.com/miniflux/miniflux/errors" - "github.com/miniflux/miniflux/helper" "github.com/miniflux/miniflux/http" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/icon" "github.com/miniflux/miniflux/reader/processor" "github.com/miniflux/miniflux/storage" + "github.com/miniflux/miniflux/timer" ) var ( @@ -34,7 +34,7 @@ type Handler struct { // CreateFeed fetch, parse and store a new feed. func (h *Handler) CreateFeed(userID, categoryID int64, url string, crawler bool) (*model.Feed, error) { - defer helper.ExecutionTime(time.Now(), fmt.Sprintf("[Handler:CreateFeed] feedUrl=%s", url)) + defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Handler:CreateFeed] feedUrl=%s", url)) if !h.store.CategoryExists(userID, categoryID) { return nil, errors.NewLocalizedError(errCategoryNotFound) @@ -96,7 +96,7 @@ func (h *Handler) CreateFeed(userID, categoryID int64, url string, crawler bool) // RefreshFeed fetch and update a feed if necessary. func (h *Handler) RefreshFeed(userID, feedID int64) error { - defer helper.ExecutionTime(time.Now(), fmt.Sprintf("[Handler:RefreshFeed] feedID=%d", feedID)) + defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Handler:RefreshFeed] feedID=%d", feedID)) originalFeed, err := h.store.FeedByID(userID, feedID) if err != nil { diff --git a/reader/feed/parser.go b/reader/feed/parser.go index 5f87708..e612f39 100644 --- a/reader/feed/parser.go +++ b/reader/feed/parser.go @@ -12,12 +12,12 @@ import ( "strings" "time" - "github.com/miniflux/miniflux/helper" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/atom" "github.com/miniflux/miniflux/reader/json" "github.com/miniflux/miniflux/reader/rdf" "github.com/miniflux/miniflux/reader/rss" + "github.com/miniflux/miniflux/timer" "golang.org/x/net/html/charset" ) @@ -33,7 +33,7 @@ const ( // DetectFeedFormat detect feed format from input data. func DetectFeedFormat(data io.Reader) string { - defer helper.ExecutionTime(time.Now(), "[Feed:DetectFeedFormat]") + defer timer.ExecutionTime(time.Now(), "[Feed:DetectFeedFormat]") var buffer bytes.Buffer tee := io.TeeReader(data, &buffer) @@ -67,7 +67,7 @@ func DetectFeedFormat(data io.Reader) string { } func parseFeed(data io.Reader) (*model.Feed, error) { - defer helper.ExecutionTime(time.Now(), "[Feed:ParseFeed]") + defer timer.ExecutionTime(time.Now(), "[Feed:ParseFeed]") var buffer bytes.Buffer io.Copy(&buffer, data) diff --git a/reader/icon/finder.go b/reader/icon/finder.go index 977a089..2e7cb16 100644 --- a/reader/icon/finder.go +++ b/reader/icon/finder.go @@ -11,7 +11,7 @@ import ( "io/ioutil" "strings" - "github.com/miniflux/miniflux/helper" + "github.com/miniflux/miniflux/crypto" "github.com/miniflux/miniflux/http" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" @@ -107,7 +107,7 @@ func downloadIcon(iconURL string) (*model.Icon, error) { } icon := &model.Icon{ - Hash: helper.HashFromBytes(body), + Hash: crypto.HashFromBytes(body), MimeType: response.ContentType, Content: body, } @@ -146,7 +146,7 @@ func parseImageDataURL(value string) (*model.Icon, error) { } icon := &model.Icon{ - Hash: helper.HashFromBytes(blob), + Hash: crypto.HashFromBytes(blob), Content: blob, MimeType: mimeType, } diff --git a/reader/json/json.go b/reader/json/json.go index 900a920..81b38f6 100644 --- a/reader/json/json.go +++ b/reader/json/json.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/miniflux/miniflux/helper" + "github.com/miniflux/miniflux/crypto" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/date" @@ -105,7 +105,7 @@ func (j *jsonItem) GetAuthor() string { func (j *jsonItem) GetHash() string { for _, value := range []string{j.ID, j.URL, j.Text + j.HTML + j.Summary} { if value != "" { - return helper.Hash(value) + return crypto.Hash(value) } } diff --git a/reader/rdf/rdf.go b/reader/rdf/rdf.go index 3586f6e..d9f3403 100644 --- a/reader/rdf/rdf.go +++ b/reader/rdf/rdf.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/miniflux/miniflux/helper" + "github.com/miniflux/miniflux/crypto" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/sanitizer" "github.com/miniflux/miniflux/url" @@ -73,5 +73,5 @@ func getHash(r *rdfItem) string { value = r.Title + r.Description } - return helper.Hash(value) + return crypto.Hash(value) } diff --git a/reader/rss/rss.go b/reader/rss/rss.go index 2a7dc3e..b7fc1d0 100644 --- a/reader/rss/rss.go +++ b/reader/rss/rss.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/miniflux/miniflux/helper" + "github.com/miniflux/miniflux/crypto" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/date" @@ -157,7 +157,7 @@ func (r *rssItem) GetAuthor() string { func (r *rssItem) GetHash() string { for _, value := range []string{r.GUID, r.GetURL()} { if value != "" { - return helper.Hash(value) + return crypto.Hash(value) } } diff --git a/reader/subscription/finder.go b/reader/subscription/finder.go index a550b13..c3bf8bb 100644 --- a/reader/subscription/finder.go +++ b/reader/subscription/finder.go @@ -11,10 +11,10 @@ import ( "time" "github.com/miniflux/miniflux/errors" - "github.com/miniflux/miniflux/helper" "github.com/miniflux/miniflux/http" "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/reader/feed" + "github.com/miniflux/miniflux/timer" "github.com/miniflux/miniflux/url" "github.com/PuerkitoBio/goquery" @@ -27,7 +27,7 @@ var ( // FindSubscriptions downloads and try to find one or more subscriptions from an URL. func FindSubscriptions(websiteURL string) (Subscriptions, error) { - defer helper.ExecutionTime(time.Now(), fmt.Sprintf("[FindSubscriptions] url=%s", websiteURL)) + defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[FindSubscriptions] url=%s", websiteURL)) client := http.NewClient(websiteURL) response, err := client.Get() |