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

@ -26,6 +26,11 @@ type Client struct {
apiKey string
}
// NewClient returns a new Nunux Keeepr client.
func NewClient(baseURL, apiKey string) *Client {
return &Client{baseURL: baseURL, apiKey: apiKey}
}
// AddEntry sends an entry to Nunux Keeper.
func (c *Client) AddEntry(link, title, content string) error {
if c.baseURL == "" || c.apiKey == "" {
@ -58,11 +63,6 @@ func (c *Client) AddEntry(link, title, content string) error {
return nil
}
// NewClient returns a new Nunux Keeepr client.
func NewClient(baseURL, apiKey string) *Client {
return &Client{baseURL: baseURL, apiKey: apiKey}
}
func getAPIEndpoint(baseURL, pathURL string) (string, error) {
u, err := url.Parse(baseURL)
if err != nil {