backend

package
v0.72.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package backend defines the Backend interface for note storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Write(n *note.Note) error
	Read(id string) (*note.Note, error)
	Delete(id string) error
	List() ([]*note.Note, error)
	AddLink(fromID, toID, annotation, linkType, linkStatus string) error
	AddLinks(fromID string, targets []LinkTarget) error
	RemoveLink(fromID, toID string) error
	RemoveLinkByType(fromID, toID, linkType string) error
	Promote(id string, to note.Status) error
	Update(n *note.Note) error
	UpdateLink(fromID, toID string, annotation, linkType, linkStatus *string) error
	BulkUpdateLinks(fromID string, updates []LinkUpdate) error
	BulkWrite(notes []*note.Note) error
}

Backend abstracts note storage so the CLI can be tested and extended without depending on a specific implementation.

type LinkTarget

type LinkTarget struct {
	ToID       string
	Annotation string
	Type       string // optional
	Status     string // "draft" or "reviewed"; defaults to "draft" if empty
}

LinkTarget is a (toID, annotation, optional type, optional status) pair used by AddLinks.

type LinkUpdate

type LinkUpdate struct {
	ToID       string
	Annotation *string // nil = leave unchanged
	Type       *string // nil = leave unchanged
	Status     *string // nil = leave unchanged
}

LinkUpdate is a (toID, optional annotation, optional type, optional status) used by BulkUpdateLinks.

Directories

Path Synopsis
Package gitlocal implements the Backend interface using the local filesystem with a Git repository for history.
Package gitlocal implements the Backend interface using the local filesystem with a Git repository for history.

Jump to

Keyboard shortcuts

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