1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Rename helper packages

This commit is contained in:
Frédéric Guillot 2018-01-02 19:15:08 -08:00
parent 3c3f397bf5
commit c39f2e1a8d
31 changed files with 97 additions and 97 deletions

View file

@ -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)
}
}

View file

@ -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 {

View file

@ -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)

View file

@ -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,
}

View file

@ -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)
}
}

View file

@ -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)
}

View file

@ -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)
}
}

View file

@ -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()