1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add Fever API

This commit is contained in:
Frédéric Guillot 2017-12-03 17:44:27 -08:00
parent ae62e543d3
commit bc20e0884b
24 changed files with 984 additions and 37 deletions

View file

@ -4,6 +4,11 @@
package model
import (
"encoding/base64"
"fmt"
)
// Icon represents a website icon (favicon)
type Icon struct {
ID int64 `json:"id"`
@ -12,6 +17,14 @@ type Icon struct {
Content []byte `json:"content"`
}
// DataURL returns the data URL of the icon.
func (i *Icon) DataURL() string {
return fmt.Sprintf("%s;base64,%s", i.MimeType, base64.StdEncoding.EncodeToString(i.Content))
}
// Icons represents a list of icon.
type Icons []*Icon
// FeedIcon is a jonction table between feeds and icons
type FeedIcon struct {
FeedID int64 `json:"feed_id"`