Help us shape the future of Go! Take the 2026 Go Developer Survey

notes

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package notes queries indexed summaries and coordinates deletion and index rebuilding. Source documents remain authoritative; index operations never rewrite their content.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteCommand

type DeleteCommand struct {
	ID string
}

DeleteCommand identifies any kind of note using raw input.

type DeleteHandler

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

DeleteHandler removes a source document before deleting its searchable projection.

func NewDeleteHandler

func NewDeleteHandler(store ports.NoteStore, index ports.Index) *DeleteHandler

NewDeleteHandler creates the use-case handler with its dependencies.

func (*DeleteHandler) Handle

func (handler *DeleteHandler) Handle(ctx context.Context, command DeleteCommand) (DeleteResult, error)

Handle removes the source document before its derived index entry. Both removals are idempotent, so retrying also repairs a previous partial failure.

type DeleteResult

type DeleteResult struct {
	ID uuid.UUID
}

DeleteResult identifies the note whose source and projection have been removed.

type ListHandler

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

ListHandler validates filters and queries derived note summaries.

func NewListHandler

func NewListHandler(index ports.Index) *ListHandler

NewListHandler creates the use-case handler with its dependencies.

func (*ListHandler) Handle

func (handler *ListHandler) Handle(ctx context.Context, query ListQuery) (ListResult, error)

Handle normalizes type and tag filters and applies bounded pagination to the index query.

type ListQuery

type ListQuery struct {
	Type   string
	Tag    string
	Limit  int
	Offset int
}

ListQuery filters the index; zero Limit defaults to 100 notes.

type ListResult

type ListResult struct {
	Notes []ports.NoteSummary
}

ListResult contains one page of indexed note summaries.

type ReindexCommand

type ReindexCommand struct{}

ReindexCommand requests a complete rebuild from the current vault documents.

type ReindexHandler

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

ReindexHandler scans the vault and rebuilds all projections in one index transaction.

func NewReindexHandler

func NewReindexHandler(store ports.NoteStore, index ports.Index) *ReindexHandler

NewReindexHandler creates the use-case handler with its dependencies.

func (*ReindexHandler) Handle

func (handler *ReindexHandler) Handle(ctx context.Context, _ ReindexCommand) (ReindexResult, error)

Handle reconstructs the complete index from documents. A failed scan or projection rolls back the replacement, including removals of stale entries.

type ReindexResult

type ReindexResult struct {
	Indexed int
}

ReindexResult counts documents indexed after a successful transaction.

Jump to

Keyboard shortcuts

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