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: 11 Imported by: 0

Documentation

Overview

Package karakeep implements the Karakeep adapter for the bookmark capability.

Package karakeep implements the bookmark management capability.

Index

Constants

View Source
const (
	OpList       = "list"
	OpGet        = "get"
	OpCreate     = "create"
	OpDelete     = "delete"
	OpArchive    = "archive"
	OpSearch     = "search"
	OpAttachTags = "attach_tags"
	OpDetachTags = "detach_tags"
	OpCheckURL   = "check_url"
	OpHealth     = "health"
)

Operation name constants for the karakeep capability.

Variables

This section is empty.

Functions

func Register

func Register(app string, svc Service) error

Register registers the karakeep capability with hub and invoker registry. When svc is nil the provider is not configured and registration is skipped.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func (*Adapter) Archive

func (a *Adapter) Archive(ctx context.Context, id string) (bool, error)

func (*Adapter) AttachTags

func (a *Adapter) AttachTags(ctx context.Context, id string, tags []string) error

func (*Adapter) CheckURL

func (a *Adapter) CheckURL(ctx context.Context, url string) (bool, string, error)

func (*Adapter) Create

func (a *Adapter) Create(ctx context.Context, url string) (*capability.Bookmark, error)

func (*Adapter) Delete

func (a *Adapter) Delete(ctx context.Context, id string) error

func (*Adapter) DetachTags

func (a *Adapter) DetachTags(ctx context.Context, id string, tags []string) error

func (*Adapter) Get

func (a *Adapter) Get(ctx context.Context, id string) (*capability.Bookmark, error)

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)

HealthCheck reports whether the Karakeep backend is reachable by listing a single bookmark page.

func (*Adapter) List

func (*Adapter) Search

func (*Adapter) SetCursorSecret

func (a *Adapter) SetCursorSecret(secret []byte)

type ListQuery

type ListQuery = capability.BookmarkListQuery

ListQuery wraps pagination and filters for listing bookmarks.

type SearchQuery

type SearchQuery = capability.BookmarkSearchQuery

SearchQuery wraps pagination for searching bookmarks.

type Service

type Service interface {
	List(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.Bookmark], error)
	Get(ctx context.Context, id string) (*capability.Bookmark, error)
	Create(ctx context.Context, url string) (*capability.Bookmark, error)
	Delete(ctx context.Context, id string) error
	Archive(ctx context.Context, id string) (bool, error)
	Search(ctx context.Context, q *SearchQuery) (*capability.ListResult[capability.Bookmark], error)
	AttachTags(ctx context.Context, id string, tags []string) error
	DetachTags(ctx context.Context, id string, tags []string) error
	CheckURL(ctx context.Context, url string) (exists bool, id string, err error)
	HealthCheck(ctx context.Context) (bool, error)
}

Service defines the bookmark capability contract.

func New

func New() Service

func NewWithClient

func NewWithClient(client client) Service

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook implements capability.WebhookConverter for Karakeep. It validates Bearer token auth and converts Karakeep webhook payloads.

func NewWebhook

func NewWebhook() *Webhook

NewWebhook creates a Webhook that reads the Bearer token from provider config lazily at verification time (following the example webhook pattern).

func (*Webhook) Convert

func (*Webhook) Convert(body []byte, _ map[string]string) ([]types.DataEvent, error)

Convert transforms the raw Karakeep webhook body into a DataEvent record. The headers parameter is accepted for interface compliance but unused.

func (*Webhook) VerifySignature

func (w *Webhook) VerifySignature(headers map[string]string, _ []byte) error

VerifySignature validates the Bearer token from the Authorization header. The body parameter is accepted for interface compliance but unused (Bearer auth does not sign the body).

func (*Webhook) WebhookPath

func (*Webhook) WebhookPath() string

WebhookPath returns the URL path segment for Karakeep webhooks. The full URL is /webhook/provider/karakeep/events.

Jump to

Keyboard shortcuts

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