note

package
v0.92.1 Latest Latest
Warning

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

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

Documentation

Overview

Package note implements the note capability for note-taking systems.

Index

Constants

Capability is the note capability type constant.

Variables

This section is empty.

Functions

func Descriptor

func Descriptor(backend, app string, svc Service) hub.Descriptor

Descriptor returns the hub capability descriptor for the note capability.

func RegisterService

func RegisterService(backend, app string, svc Service) error

RegisterService registers the note capability with the hub and ability registry. It returns nil and logs a warning when svc is nil (provider not configured).

Types

type ListQuery

type ListQuery struct {
	Page  ability.PageRequest
	Query string // optional search query
}

ListQuery wraps pagination for listing notes.

type Service

type Service interface {
	// List returns a paginated list of notes, optionally filtered by query.
	List(ctx context.Context, q *ListQuery) (*ability.ListResult[ability.Note], error)
	// Get returns a single note by its ID.
	Get(ctx context.Context, id string) (*ability.Note, error)
	// Create creates a new note with the given parameters.
	Create(ctx context.Context, title, content, typ, parentNoteID string) (*ability.Note, error)
	// Update updates a note's title and/or content.
	Update(ctx context.Context, id, title, content string) (*ability.Note, error)
	// Delete removes a note by its ID.
	Delete(ctx context.Context, id string) error
	// GetContent retrieves the full content of a note.
	GetContent(ctx context.Context, id string) (string, error)
	// SetContent sets the full content of a note.
	SetContent(ctx context.Context, id, content string) error
	// Search searches notes by the given query string.
	Search(ctx context.Context, query string) (*ability.ListResult[ability.Note], error)
	// GetAppInfo returns information about the running note server instance.
	GetAppInfo(ctx context.Context) (*ability.Note, error)
	// ListRawEvents lists notes as raw events for polling support.
	ListRawEvents(ctx context.Context, cursor string) ([]any, string, error)
}

Service defines the note capability contract. Provider adapters implement this interface to bridge providers and invokers.

Directories

Path Synopsis
Package trilium implements the Trilium adapter for the note capability.
Package trilium implements the Trilium adapter for the note capability.

Jump to

Keyboard shortcuts

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