notes

package
v0.0.0-...-20f8cf1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(path string) (*sql.DB, error)

OpenDB opens (or creates) the SQLite database at path and runs migrations.

Types

type Note

type Note struct {
	ID        string    `json:"id"`
	Host      string    `json:"host"`
	Content   string    `json:"content"`
	Author    string    `json:"author"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Note represents a per-host operator note.

type Store

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

Store provides CRUD operations for notes.

func NewStore

func NewStore(db *sql.DB) *Store

NewStore creates a new Store.

func (*Store) ClearAll

func (s *Store) ClearAll() error

ClearAll deletes all notes from the store.

func (*Store) CreateNote

func (s *Store) CreateNote(id, host, content, author string) (*Note, error)

CreateNote inserts a new note.

func (*Store) DeleteNote

func (s *Store) DeleteNote(id string) error

DeleteNote deletes a note by ID.

func (*Store) ListHosts

func (s *Store) ListHosts() ([]string, error)

ListHosts returns all distinct hosts that have notes.

func (*Store) ListNotes

func (s *Store) ListNotes(host string, offset, limit int) ([]Note, int, error)

ListNotes returns notes for a host, paginated.

func (*Store) LoadAll

func (s *Store) LoadAll() ([]Note, error)

LoadAll returns every note in the store (used for serialising into project configs).

Jump to

Keyboard shortcuts

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