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:
parent
34dd358eb0
commit
49119eff00
16 changed files with 57 additions and 108 deletions
|
@ -22,6 +22,11 @@ type Client struct {
|
|||
password string
|
||||
}
|
||||
|
||||
// NewClient returns a new Wallabag client.
|
||||
func NewClient(baseURL, clientID, clientSecret, username, password string) *Client {
|
||||
return &Client{baseURL, clientID, clientSecret, username, password}
|
||||
}
|
||||
|
||||
// AddEntry sends a link to Wallabag.
|
||||
// Pass an empty string in `content` to let Wallabag fetch the article content.
|
||||
func (c *Client) AddEntry(link, title, content string) error {
|
||||
|
@ -88,11 +93,6 @@ func (c *Client) getAccessToken() (string, error) {
|
|||
return token.AccessToken, nil
|
||||
}
|
||||
|
||||
// NewClient returns a new Wallabag client.
|
||||
func NewClient(baseURL, clientID, clientSecret, username, password string) *Client {
|
||||
return &Client{baseURL, clientID, clientSecret, username, password}
|
||||
}
|
||||
|
||||
func getAPIEndpoint(baseURL, path string) (string, error) {
|
||||
u, err := url.Parse(baseURL)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue