web

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package web is the HTTP adapter: a localhost notes viewer (`nt web`). It is a read adapter over the same domain (note/links/mutate) the CLI, TUI, and MCP server use — so it shows exactly what they store. It is deliberately structured to make editing a future additive change: state lives on the Server struct, notes are addressed by stable id, and the render path is one reusable function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(version, addr string) error

Serve opens the store and serves the viewer on addr (e.g. "127.0.0.1:0").

Types

type Backlink struct {
	Title  string // note title, or "" for a task source
	URL    string // /n/<id> for a note source; "" for a task
	Text   string // the matching line (shown for task sources)
	IsNote bool
}

Backlink is one "Linked from" entry for the note page.

type Server

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

Server holds the shared state for the viewer. (Editing, when added, hangs write routes and a CSRF token here — seam #1.)

func NewServer

func NewServer(eng *mutate.Engine, version string) (*Server, error)

NewServer parses the embedded template and prepares the viewer.

type TaskRef

type TaskRef struct {
	Text   string
	Status string
	Source string
}

TaskRef is one task that links to the note (the task↔note moat).

Jump to

Keyboard shortcuts

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