Documentation
¶
Index ¶
- Variables
- type Bookmark
- type Client
- func (c *Client) ArchiveBookmark(id int) error
- func (c *Client) CreateBookmark(payload CreateBookmarkRequest) (*Bookmark, error)
- func (c *Client) CreateTag(name string) (*Tag, error)
- func (c *Client) DeleteBookmark(id int) error
- func (c *Client) GetBookmark(id int) (*Bookmark, error)
- func (c *Client) GetTag(id int) (*Tag, error)
- func (c *Client) GetUserPreferences() (*UserPreferences, error)
- func (c *Client) ListArchivedBookmarks(params ListBookmarksParams) (*ListBookmarksResponse, error)
- func (c *Client) ListBookmarks(params ListBookmarksParams) (*ListBookmarksResponse, error)
- func (c *Client) ListTags(params ListTagsParams) (*ListTagsResponse, error)
- func (c *Client) UnarchiveBookmark(id int) error
- func (c *Client) UpdateBookmark(id int, payload CreateBookmarkRequest) (*Bookmark, error)
- type CreateBookmarkRequest
- type CreateTagRequest
- type ListBookmarksParams
- type ListBookmarksResponse
- type ListTagsParams
- type ListTagsResponse
- type Tag
- type UserPreferences
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Bookmark ¶
type Bookmark struct {
ID int `json:"id"`
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
Notes string `json:"notes"`
WebsiteTitle string `json:"website_title"`
WebsiteDescription string `json:"website_description"`
WebArchiveSnapshotURL string `json:"web_archive_snapshot_url"`
FaviconURL string `json:"favicon_url"`
PreviewImageURL string `json:"preview_image_url"`
IsArchived bool `json:"is_archived"`
Unread bool `json:"unread"`
TagNames []string `json:"tag_names"`
DateAdded time.Time `json:"date_added"`
DateModified time.Time `json:"date_modified"`
}
Bookmark represents a bookmark object in the Linkding API.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles all interactions with the Linkding API.
func NewClient ¶
NewClient creates a new Linkding API client using the given URL and token.
The URL provided must be a complete URL. It must contain a schema and the domain for the API. Do not include the prefix path of the API. e.g. "https://linkding.example.org".
func (*Client) ArchiveBookmark ¶
ArchiveBookmark archives a bookmark from Linkding.
func (*Client) CreateBookmark ¶
func (c *Client) CreateBookmark(payload CreateBookmarkRequest) (*Bookmark, error)
CreateBookmark creates a new bookmark in Linkding using the provided payload.
Warning: Ensure that the TagNames property in the CreateBookmarkRequest is initialized (even if empty) to avoid nil pointer issues.
func (*Client) DeleteBookmark ¶
DeleteBookmark deletes a bookmark from Linkding.
func (*Client) GetBookmark ¶
GetBookmark retrieves a single bookmark from Linkding.
func (*Client) GetUserPreferences ¶
func (c *Client) GetUserPreferences() (*UserPreferences, error)
GetUserPreferences retrieves the user's preferences from Linkding.
func (*Client) ListArchivedBookmarks ¶
func (c *Client) ListArchivedBookmarks(params ListBookmarksParams) (*ListBookmarksResponse, error)
ListArchivedBookmarks retrieves a list of archived bookmarks from Linkding. It also filters the list based on the provided parameters.
func (*Client) ListBookmarks ¶
func (c *Client) ListBookmarks(params ListBookmarksParams) (*ListBookmarksResponse, error)
ListBookmarks retrieves a list of bookmarks from Linkding based on the provided parameters.
func (*Client) ListTags ¶
func (c *Client) ListTags(params ListTagsParams) (*ListTagsResponse, error)
ListTags retrieves a list of tags from Linkding based on the provided parameters.
func (*Client) UnarchiveBookmark ¶
UnarchiveBookmark unarchives a bookmark from Linkding.
func (*Client) UpdateBookmark ¶
func (c *Client) UpdateBookmark(id int, payload CreateBookmarkRequest) (*Bookmark, error)
UpdateBookmark updates an existing bookmark in Linkding using the provided payload.
Warning: Ensure that the TagNames property in the CreateBookmarkRequest is initialized (even if empty) to avoid nil pointer issues.
type CreateBookmarkRequest ¶
type CreateBookmarkRequest struct {
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
Notes string `json:"notes"`
IsArchived bool `json:"is_archived"`
Unread bool `json:"unread"`
TagNames []string `json:"tag_names"`
}
CreateBookmarkRequest represents the request body when creating or updating bookmarks.
type CreateTagRequest ¶
type CreateTagRequest struct {
Name string `json:"name"`
}
CreateTagRequest represents the request body when creating a new tag.
type ListBookmarksParams ¶
type ListBookmarksParams struct {
// The search query to filter bookmarks.
Query string
// The maximum number of bookmarks to return.
Limit int
// The offset for pagination.
Offset int
// Filter to include only unread bookmarks.
Unread bool
}
ListBookmarksParams defines the parameters used when listing bookmarks.
type ListBookmarksResponse ¶
type ListBookmarksResponse struct {
Count int `json:"count"`
Next string `json:"next"`
Previous string `json:"previous"`
Results []Bookmark `json:"results"`
}
ListBookmarksResponse represents the response from the Linkding API when listing bookmarks.
type ListTagsParams ¶
type ListTagsParams struct {
// The maximum number of tags to return.
Limit int
// The offset for pagination.
Offset int
}
ListTagsParams defines the parameters used when listing tags.
type ListTagsResponse ¶
type ListTagsResponse struct {
Count int `json:"count"`
Next string `json:"next"`
Previous string `json:"previous"`
Results []Tag `json:"results"`
}
ListTagsResponse represents the response from the Linkding API when listing tags.
type Tag ¶
type Tag struct {
ID int `json:"id"`
Name string `json:"name"`
DateAdded time.Time `json:"date_added"`
}
Tag represents a tag object in the Linkding API.
type UserPreferences ¶
type UserPreferences struct {
Theme string `json:"theme"`
BookmarkDateDisplay string `json:"bookmark_date_display"`
BookmarkLinkTarget string `json:"bookmark_link_target"`
WebArchiveIntegration string `json:"web_archive_integration"`
TagSearch string `json:"tag_search"`
EnableSharing bool `json:"enable_sharing"`
EnablePublicSharing bool `json:"enable_public_sharing"`
EnableFavicons bool `json:"enable_favicons"`
DisplayURL bool `json:"display_url"`
PermanentNotes bool `json:"permanent_notes"`
SearchPreferences struct {
Sort string `json:"sort"`
Shared string `json:"shared"`
Unread string `json:"unread"`
} `json:"search_preferences"`
}
UserPreferences represents the user-specific settings in the Linkding API.