Documentation
¶
Overview ¶
Package karakeep implements the Karakeep bookmark provider.
Index ¶
- Constants
- func GetWebhookToken() string
- type ArchiveResponse
- type AttachTagsResponse
- type Bookmark
- type BookmarkContent
- type BookmarkTagRequest
- type BookmarkTagsInner
- type BookmarksBookmarkIdAssets
- type BookmarksQuery
- type BookmarksResponse
- type CheckUrlResponse
- type DetachTagsResponse
- type Karakeep
- func (i *Karakeep) ArchiveBookmark(id string) (bool, error)
- func (i *Karakeep) AttachTagsToBookmark(bookmarkId string, tags []string) ([]string, error)
- func (i *Karakeep) CheckUrlExists(url string) (*string, error)
- func (i *Karakeep) CreateBookmark(url string) (*Bookmark, error)
- func (i *Karakeep) DetachTagsToBookmark(bookmarkId string, tags []string) ([]string, error)
- func (i *Karakeep) GetAllBookmarks(query *BookmarksQuery) (*BookmarksResponse, error)
- func (i *Karakeep) GetAllTags() ([]Tag, error)
- func (i *Karakeep) GetBookmark(id string) (*Bookmark, error)
- func (i *Karakeep) SearchBookmarks(query *SearchBookmarksQuery) (*BookmarksResponse, error)
- type SearchBookmarksQuery
- type Tag
- type TagNumBookmarksByAttachedType
- type TagsResponse
- type WebhookPayload
Constants ¶
View Source
const ( ID = "karakeep" EndpointKey = "endpoint" ApikeyKey = "api_key" WebhookTokenKey = "webhook_token" )
View Source
const (
MaxPageSize = 100
)
Variables ¶
This section is empty.
Functions ¶
func GetWebhookToken ¶
func GetWebhookToken() string
GetWebhookToken reads the webhook Bearer token from the karakeep provider config.
Types ¶
type ArchiveResponse ¶
type ArchiveResponse struct {
Archived bool `json:"archived"`
}
type AttachTagsResponse ¶
type AttachTagsResponse struct {
Attached []string `json:"attached"`
}
type Bookmark ¶
type Bookmark struct {
Id string `json:"id"`
CreatedAt string `json:"createdAt"`
ModifiedAt *string `json:"modifiedAt,omitzero"`
Title *string `json:"title,omitzero"`
Archived bool `json:"archived"`
Favourited bool `json:"favourited"`
TaggingStatus *string `json:"taggingStatus,omitzero"`
// summarization status was added in API responses starting
// with the new /bookmarks/:id endpoint and is not returned
// by the older list call. Use a pointer to distinguish
// missing values.
SummarizationStatus *string `json:"summarizationStatus,omitzero"`
Source *string `json:"source,omitzero"`
UserId *string `json:"userId,omitzero"`
Note *string `json:"note,omitzero"`
Summary *string `json:"summary,omitzero"`
Tags []BookmarkTagsInner `json:"tags"`
Assets []BookmarksBookmarkIdAssets `json:"assets"`
Content BookmarkContent `json:"content"`
}
func (Bookmark) GetSummary ¶
type BookmarkContent ¶
type BookmarkContent struct {
Type string `json:"type"`
Url string `json:"url"`
Title *string `json:"title,omitzero"`
Description *string `json:"description,omitzero"`
ImageUrl *string `json:"imageUrl,omitzero"`
ImageAssetId *string `json:"imageAssetId,omitzero"`
ScreenshotAssetId *string `json:"screenshotAssetId,omitzero"`
FullPageArchiveAssetId *string `json:"fullPageArchiveAssetId,omitzero"`
PrecrawledArchiveAssetId *string `json:"precrawledArchiveAssetId,omitzero"`
VideoAssetId *string `json:"videoAssetId,omitzero"`
Favicon *string `json:"favicon,omitzero"`
HtmlContent *string `json:"htmlContent,omitzero"`
CrawledAt *string `json:"crawledAt,omitzero"`
}
type BookmarkTagRequest ¶
type BookmarkTagRequest struct {
TagName string `json:"tag_name"`
}
type BookmarkTagsInner ¶
type BookmarksQuery ¶
type BookmarksResponse ¶
type CheckUrlResponse ¶
type CheckUrlResponse struct {
BookmarkId *string `json:"bookmarkId"`
}
type DetachTagsResponse ¶
type DetachTagsResponse struct {
Detached []string `json:"detached"`
}
type Karakeep ¶
type Karakeep struct {
// contains filtered or unexported fields
}
func NewKarakeep ¶
func (*Karakeep) AttachTagsToBookmark ¶
func (*Karakeep) DetachTagsToBookmark ¶
func (*Karakeep) GetAllBookmarks ¶
func (i *Karakeep) GetAllBookmarks(query *BookmarksQuery) (*BookmarksResponse, error)
func (*Karakeep) GetAllTags ¶
func (*Karakeep) GetBookmark ¶
GetBookmark retrieves a single bookmark by its ID. This corresponds to GET /bookmarks/:bookmarkId in the karakeep API and returns the full bookmark object, including fields that are not present in the list response (summarizationStatus, source, userId, etc.).
The caller is responsible for handling a nil result or any error produced by the underlying HTTP client.
func (*Karakeep) SearchBookmarks ¶
func (i *Karakeep) SearchBookmarks(query *SearchBookmarksQuery) (*BookmarksResponse, error)
type SearchBookmarksQuery ¶
type Tag ¶
type Tag struct {
Id string `json:"id"`
Name string `json:"name"`
NumBookmarks float32 `json:"numBookmarks"`
NumBookmarksByAttachedType TagNumBookmarksByAttachedType `json:"numBookmarksByAttachedType"`
}
type TagsResponse ¶
type TagsResponse struct {
Tags []Tag `json:"tags"`
}
type WebhookPayload ¶
type WebhookPayload struct {
JobID string `json:"jobId"`
BookmarkID string `json:"bookmarkId"`
UserID string `json:"userId"`
URL string `json:"url"`
Type string `json:"type"`
Operation string `json:"operation"`
}
WebhookPayload is the incoming Karakeep webhook request body. Shape matches apps/workers/workers/webhookWorker.ts in karakeep-app/karakeep.
Click to show internal directories.
Click to hide internal directories.