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

Add per-application API Keys

This commit is contained in:
Frédéric Guillot 2020-03-01 17:38:29 -08:00
parent d1afe13a1c
commit 25cc0d2447
35 changed files with 940 additions and 71 deletions

View file

@ -18,6 +18,14 @@ type Client struct {
request *request
}
// New returns a new Miniflux client.
func New(endpoint string, credentials ...string) *Client {
if len(credentials) == 2 {
return &Client{request: &request{endpoint: endpoint, username: credentials[0], password: credentials[1]}}
}
return &Client{request: &request{endpoint: endpoint, apiKey: credentials[0]}}
}
// Me returns the logged user information.
func (c *Client) Me() (*User, error) {
body, err := c.request.Get("/v1/me")
@ -448,11 +456,6 @@ func (c *Client) ToggleBookmark(entryID int64) error {
return nil
}
// New returns a new Miniflux client.
func New(endpoint, username, password string) *Client {
return &Client{request: &request{endpoint: endpoint, username: username, password: password}}
}
func buildFilterQueryString(path string, filter *Filter) string {
if filter != nil {
values := url.Values{}