diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-12-22 11:33:01 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-12-22 11:33:01 -0800 |
commit | 9868f900e972edd6d4811b4a93b1955e4222e9b1 (patch) | |
tree | f366decff3a14c58a6869a1993b5698d6acce19a /vendor | |
parent | b153fa8b3cd2e48bbe13326695f11d2013427ebc (diff) |
Add bookmarks
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/miniflux/miniflux-go/client.go | 32 | ||||
-rw-r--r-- | vendor/github.com/miniflux/miniflux-go/miniflux.go | 1 |
2 files changed, 31 insertions, 2 deletions
diff --git a/vendor/github.com/miniflux/miniflux-go/client.go b/vendor/github.com/miniflux/miniflux-go/client.go index 905ec53..7350a70 100644 --- a/vendor/github.com/miniflux/miniflux-go/client.go +++ b/vendor/github.com/miniflux/miniflux-go/client.go @@ -291,8 +291,8 @@ func (c *Client) FeedIcon(feedID int64) (*FeedIcon, error) { return feedIcon, nil } -// Entry gets a single feed entry. -func (c *Client) Entry(feedID, entryID int64) (*Entry, error) { +// FeedEntry gets a single feed entry. +func (c *Client) FeedEntry(feedID, entryID int64) (*Entry, error) { body, err := c.request.Get(fmt.Sprintf("/v1/feeds/%d/entries/%d", feedID, entryID)) if err != nil { return nil, err @@ -308,6 +308,23 @@ func (c *Client) Entry(feedID, entryID int64) (*Entry, error) { return entry, nil } +// Entry gets a single entry. +func (c *Client) Entry(entryID int64) (*Entry, error) { + body, err := c.request.Get(fmt.Sprintf("/v1/entries/%d", entryID)) + if err != nil { + return nil, err + } + defer body.Close() + + var entry *Entry + decoder := json.NewDecoder(body) + if err := decoder.Decode(&entry); err != nil { + return nil, fmt.Errorf("miniflux: response error (%v)", err) + } + + return entry, nil +} + // Entries fetch entries. func (c *Client) Entries(filter *Filter) (*EntryResultSet, error) { path := buildFilterQueryString("/v1/entries", filter) @@ -362,6 +379,17 @@ func (c *Client) UpdateEntries(entryIDs []int64, status string) error { return nil } +// ToggleBookmark toggles entry bookmark value. +func (c *Client) ToggleBookmark(entryID int64) error { + body, err := c.request.Put(fmt.Sprintf("/v1/entries/%d/bookmark", entryID), nil) + if err != nil { + return err + } + body.Close() + + return nil +} + // NewClient returns a new Client. func NewClient(endpoint, username, password string) *Client { return &Client{request: &request{endpoint: endpoint, username: username, password: password}} diff --git a/vendor/github.com/miniflux/miniflux-go/miniflux.go b/vendor/github.com/miniflux/miniflux-go/miniflux.go index aefabc8..9cbdc72 100644 --- a/vendor/github.com/miniflux/miniflux-go/miniflux.go +++ b/vendor/github.com/miniflux/miniflux-go/miniflux.go @@ -101,6 +101,7 @@ type Entry struct { Date time.Time `json:"published_at"` Content string `json:"content"` Author string `json:"author"` + Starred bool `json:"starred"` Enclosures Enclosures `json:"enclosures,omitempty"` Feed *Feed `json:"feed,omitempty"` Category *Category `json:"category,omitempty"` |