aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-25 16:53:51 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-25 16:53:51 -0800
commit39b03cc393da657b11dbf25e51e2495f8739e491 (patch)
tree0231ec313a78453a8fccbac73919f25cd9cf598a /vendor/github.com
parentf072439b79ff6a003810a337664961865fefa755 (diff)
Add integration tests for feed creation
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/miniflux/miniflux-go/README.md2
-rw-r--r--vendor/github.com/miniflux/miniflux-go/client.go16
2 files changed, 11 insertions, 7 deletions
diff --git a/vendor/github.com/miniflux/miniflux-go/README.md b/vendor/github.com/miniflux/miniflux-go/README.md
index 7c7eefc..3b232b4 100644
--- a/vendor/github.com/miniflux/miniflux-go/README.md
+++ b/vendor/github.com/miniflux/miniflux-go/README.md
@@ -34,7 +34,7 @@ func main() {
client := miniflux.NewClient("https://api.example.org", "admin", "secret")
// Fetch all feeds.
- feeds, err := userClient.Feeds()
+ feeds, err := client.Feeds()
if err != nil {
fmt.Println(err)
return
diff --git a/vendor/github.com/miniflux/miniflux-go/client.go b/vendor/github.com/miniflux/miniflux-go/client.go
index 4cf40e0..6a5f678 100644
--- a/vendor/github.com/miniflux/miniflux-go/client.go
+++ b/vendor/github.com/miniflux/miniflux-go/client.go
@@ -214,23 +214,27 @@ func (c *Client) Feed(feedID int64) (*Feed, error) {
}
// CreateFeed creates a new feed.
-func (c *Client) CreateFeed(url string, categoryID int64) (*Feed, error) {
+func (c *Client) CreateFeed(url string, categoryID int64) (int64, error) {
body, err := c.request.Post("/v1/feeds", map[string]interface{}{
"feed_url": url,
"category_id": categoryID,
})
if err != nil {
- return nil, err
+ return 0, err
}
defer body.Close()
- var feed *Feed
+ type result struct {
+ FeedID int64 `json:"feed_id"`
+ }
+
+ var r result
decoder := json.NewDecoder(body)
- if err := decoder.Decode(&feed); err != nil {
- return nil, fmt.Errorf("miniflux: response error (%v)", err)
+ if err := decoder.Decode(&r); err != nil {
+ return 0, fmt.Errorf("miniflux: response error (%v)", err)
}
- return feed, nil
+ return r.FeedID, nil
}
// UpdateFeed updates a feed.