karakeep

package
v0.97.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package karakeep implements the Karakeep bookmark provider.

Index

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

func (b Bookmark) GetSummary() string

func (Bookmark) GetTitle

func (b Bookmark) GetTitle() string

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 BookmarkTagsInner struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	AttachedBy string `json:"attachedBy"`
}

type BookmarksBookmarkIdAssets

type BookmarksBookmarkIdAssets struct {
	Id        string `json:"id"`
	AssetType string `json:"assetType"`
	FileName  string `json:"fileName"`
}

type BookmarksQuery

type BookmarksQuery struct {
	Limit      int    `json:"limit"`
	Archived   bool   `json:"archived"`
	Favourited bool   `json:"favourited"`
	Cursor     string `json:"cursor"`
}

type BookmarksResponse

type BookmarksResponse struct {
	Bookmarks  []Bookmark `json:"bookmarks"`
	NextCursor string     `json:"nextCursor"`
}

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 GetClient

func GetClient() *Karakeep

func NewKarakeep

func NewKarakeep(endpoint, apiKey string) *Karakeep

func (*Karakeep) ArchiveBookmark

func (i *Karakeep) ArchiveBookmark(id string) (bool, error)

func (*Karakeep) AttachTagsToBookmark

func (i *Karakeep) AttachTagsToBookmark(bookmarkId string, tags []string) ([]string, error)

func (*Karakeep) CheckUrlExists

func (i *Karakeep) CheckUrlExists(url string) (*string, error)

func (*Karakeep) CreateBookmark

func (i *Karakeep) CreateBookmark(url string) (*Bookmark, error)

func (*Karakeep) DetachTagsToBookmark

func (i *Karakeep) DetachTagsToBookmark(bookmarkId string, tags []string) ([]string, error)

func (*Karakeep) GetAllBookmarks

func (i *Karakeep) GetAllBookmarks(query *BookmarksQuery) (*BookmarksResponse, error)

func (*Karakeep) GetAllTags

func (i *Karakeep) GetAllTags() ([]Tag, error)

func (*Karakeep) GetBookmark

func (i *Karakeep) GetBookmark(id string) (*Bookmark, error)

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 SearchBookmarksQuery struct {
	Q              string `json:"q"`
	SortOrder      string `json:"sortOrder"`
	Limit          int    `json:"limit"`
	Cursor         string `json:"cursor"`
	IncludeContent bool   `json:"includeContent"`
}

type Tag

type Tag struct {
	Id                         string                        `json:"id"`
	Name                       string                        `json:"name"`
	NumBookmarks               float32                       `json:"numBookmarks"`
	NumBookmarksByAttachedType TagNumBookmarksByAttachedType `json:"numBookmarksByAttachedType"`
}

type TagNumBookmarksByAttachedType

type TagNumBookmarksByAttachedType struct {
	Ai    *float32 `json:"ai,omitzero"`
	Human *float32 `json:"human,omitzero"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL