Documentation
¶
Overview ¶
Package note implements the note capability for note-taking systems.
Index ¶
Constants ¶
View Source
const Capability hub.CapabilityType = hub.CapNote
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.