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

Minor improvements in integration package

This commit is contained in:
Frédéric Guillot 2021-09-07 20:28:41 -07:00 committed by fguillot
parent 34dd358eb0
commit 49119eff00
16 changed files with 57 additions and 108 deletions

View file

@ -18,6 +18,11 @@ type Connector struct {
consumerKey string
}
// NewConnector returns a new Pocket Connector.
func NewConnector(consumerKey string) *Connector {
return &Connector{consumerKey}
}
// RequestToken fetches a new request token from Pocket API.
func (c *Connector) RequestToken(redirectURL string) (string, error) {
type req struct {
@ -96,8 +101,3 @@ func (c *Connector) AuthorizationURL(requestToken, redirectURL string) string {
redirectURL,
)
}
// NewConnector returns a new Pocket Connector.
func NewConnector(consumerKey string) *Connector {
return &Connector{consumerKey}
}

View file

@ -1,10 +0,0 @@
// Copyright 2018 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
/*
Package pocket provides an integration with Pocket.
*/
package pocket // import "miniflux.app/integration/pocket"

View file

@ -16,6 +16,11 @@ type Client struct {
accessToken string
}
// NewClient returns a new Pocket client.
func NewClient(consumerKey, accessToken string) *Client {
return &Client{consumerKey, accessToken}
}
// AddURL sends a single link to Pocket.
func (c *Client) AddURL(link, title string) error {
if c.consumerKey == "" || c.accessToken == "" {
@ -48,8 +53,3 @@ func (c *Client) AddURL(link, title string) error {
return nil
}
// NewClient returns a new Pocket client.
func NewClient(consumerKey, accessToken string) *Client {
return &Client{consumerKey, accessToken}
}