Documentation
¶
Overview ¶
Package karakeep implements the Karakeep adapter for the bookmark capability.
Package karakeep implements the bookmark management capability.
Index ¶
- Constants
- func Register(app string, svc Service) error
- type Adapter
- func (a *Adapter) Archive(ctx context.Context, id string) (bool, error)
- func (a *Adapter) AttachTags(ctx context.Context, id string, tags []string) error
- func (a *Adapter) CheckURL(ctx context.Context, url string) (bool, string, error)
- func (a *Adapter) Create(ctx context.Context, url string) (*capability.Bookmark, error)
- func (a *Adapter) Delete(ctx context.Context, id string) error
- func (a *Adapter) DetachTags(ctx context.Context, id string, tags []string) error
- func (a *Adapter) Get(ctx context.Context, id string) (*capability.Bookmark, error)
- func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)
- func (a *Adapter) List(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.Bookmark], error)
- func (a *Adapter) Search(ctx context.Context, q *SearchQuery) (*capability.ListResult[capability.Bookmark], error)
- func (a *Adapter) SetCursorSecret(secret []byte)
- type ListQuery
- type SearchQuery
- type Service
- type Webhook
Constants ¶
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 ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func (*Adapter) AttachTags ¶
func (*Adapter) DetachTags ¶
func (*Adapter) HealthCheck ¶
HealthCheck reports whether the Karakeep backend is reachable by listing a single bookmark page.
func (*Adapter) List ¶
func (a *Adapter) List(ctx context.Context, q *ListQuery) (*capability.ListResult[capability.Bookmark], error)
func (*Adapter) Search ¶
func (a *Adapter) Search(ctx context.Context, q *SearchQuery) (*capability.ListResult[capability.Bookmark], error)
func (*Adapter) SetCursorSecret ¶
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 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 ¶
Convert transforms the raw Karakeep webhook body into a DataEvent record. The headers parameter is accepted for interface compliance but unused.
func (*Webhook) VerifySignature ¶
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 ¶
WebhookPath returns the URL path segment for Karakeep webhooks. The full URL is /webhook/provider/karakeep/events.