Documentation ¶
Overview ¶
Package joplin implements a REST API client compatible with Joplin's API.
The API is documented here: https://github.com/laurent22/joplin/blob/master/readme/api.md
Index ¶
- type Client
- func (c *Client) BuildURL(endpoint string, parameters map[string]string) string
- func (c *Client) GetAllNotes() ([]Note, error)
- func (c *Client) GetAllTags() ([]Tag, error)
- func (c *Client) GetNote(id string) (Note, error)
- func (c *Client) GetNoteTags(id string) ([]Tag, error)
- func (c *Client) GetNotesWithTag(id string) ([]Note, error)
- func (c *Client) Ping() (bool, error)
- type Note
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Host is the host component of the URL, normally this should be // 'localhost'. Host string // Port is the port number on which Joplin's API is exposed. Normally // this should be 41184. Port int // Token should be the Joplin API token retrieved from the settings // interface by the user. Token string }
Client stores all configuration and state needed to interact with the Joplin API.
func (*Client) BuildURL ¶
BuildURL generates a URL for a given API endpoint. The token is always included but additional parameters can also be added. For example, to set the "fields" parameter, you might pass map[string]string{"fields": "body, id, title"}.
parameters may be nil.
func (*Client) GetAllNotes ¶
GetAllNotes returns a list of all notes
func (*Client) GetAllTags ¶
GetAllTags returns a list of all tags.
func (*Client) GetNoteTags ¶
GetNoteTags gets the tags attached to a particular note by it's ID.
func (*Client) GetNotesWithTag ¶
GetNotesWithTag returns a list of all notes that have the given tag ID
type Note ¶
type Note struct { ID string `json: id` ParentId string `json: parent_id` Title string `json: title` Body string `json: body` CreatedTime int `json: created_time` UpdatedTime int `json: updated_time` IsConflict int `json: is_conflict` Latitude string `json: latitude` Longitude string `json: longitude` Altitude string `json: altitude` Author string `json: author` SourceURL string `json: source_url` IsTodo int `json: is_todo` TodoCompleted int `json: todo_completed` UserCreatedTime int `json: user_created_time` UserUpdatedTime int `json: user_updated_time` }
Note represents a Joplin note object.