gitlocal

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gitlocal implements the Backend interface using the local filesystem with a Git repository for history. Each write operation produces one commit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend stores notes as Markdown files in a Git-backed directory.

func New

func New(dir string) (*Backend, error)

New returns a Backend rooted at dir, which must already be a Git repository.

func (b *Backend) AddLink(fromID, toID, annotation, linkType string) error

AddLink adds an annotated link from fromID to toID and commits.

func (b *Backend) AddLinks(fromID string, targets []backend.LinkTarget) error

AddLinks adds multiple annotated links from fromID in a single git commit.

func (b *Backend) BulkUpdateLinks(fromID string, updates []backend.LinkUpdate) error

BulkUpdateLinks applies multiple link updates to fromID in a single git commit.

func (*Backend) BulkWrite added in v0.14.0

func (b *Backend) BulkWrite(notes []*note.Note) error

BulkWrite writes all notes and commits in a single commit.

func (*Backend) Delete

func (b *Backend) Delete(id string) error

Delete removes the note file for id and commits the deletion.

func (*Backend) List

func (b *Backend) List() ([]*note.Note, error)

List returns all notes in the notebook directory.

func (*Backend) Promote

func (b *Backend) Promote(id string, to note.Status) error

Promote updates the status of the note with the given id and commits.

func (*Backend) Read

func (b *Backend) Read(id string) (*note.Note, error)

Read finds and parses the note with the given ID.

func (b *Backend) RemoveLink(fromID, toID string) error

RemoveLink removes the link from fromID to toID and commits.

func (*Backend) Update

func (b *Backend) Update(n *note.Note) error

Update writes the modified note and commits with an "update" message.

func (b *Backend) UpdateLink(fromID, toID string, annotation, linkType *string) error

UpdateLink modifies the annotation and/or type of an existing link without removing it. nil pointer arguments mean "leave unchanged".

func (*Backend) Write

func (b *Backend) Write(n *note.Note) error

Write serialises n to a Markdown file and commits it to Git.

Jump to

Keyboard shortcuts

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