Documentation
¶
Index ¶
- func ExtractYouTubeID(url string) string
- func WebhookHandler(processor WebhookProcessor, tokenResolver TokenResolver) http.HandlerFunc
- type Bookmark
- type Client
- func (c *Client) AddTag(ctx context.Context, bookmarkID, tagName string) error
- func (c *Client) GetBookmark(ctx context.Context, id string) (*Bookmark, error)
- func (c *Client) ListBookmarks(ctx context.Context) ([]Bookmark, error)
- func (c *Client) UpdateNote(ctx context.Context, bookmarkID, note string) error
- type ListBookmarksResponse
- type TokenResolver
- type WebhookPayload
- type WebhookProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractYouTubeID ¶
ExtractYouTubeID extracts the YouTube video ID from a URL.
func WebhookHandler ¶
func WebhookHandler(processor WebhookProcessor, tokenResolver TokenResolver) http.HandlerFunc
WebhookHandler returns an HTTP handler for Karakeep webhooks. The tokenResolver maps a Bearer token to a user ID.
Types ¶
type Bookmark ¶
type Bookmark struct {
ID string `json:"id"`
Content struct {
Type string `json:"type"`
URL string `json:"url"`
} `json:"content"`
Tags []struct {
Name string `json:"name"`
} `json:"tags"`
}
Bookmark represents a Karakeep bookmark.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client interacts with the Karakeep REST API.
func (*Client) AddTag ¶
AddTag attaches a tag to a bookmark. Karakeep's POST endpoint is additive, so existing tags are preserved automatically.
func (*Client) GetBookmark ¶
GetBookmark retrieves a bookmark by ID.
func (*Client) ListBookmarks ¶
ListBookmarks retrieves all bookmarks, paginating through all results.
type ListBookmarksResponse ¶
type ListBookmarksResponse struct {
Bookmarks []Bookmark `json:"bookmarks"`
NextCursor *string `json:"nextCursor"`
}
ListBookmarksResponse is the paginated response from the Karakeep bookmarks API.
type TokenResolver ¶
TokenResolver resolves a Bearer token to a user ID.
Click to show internal directories.
Click to hide internal directories.