server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package server exposes the store over an HTTP+JSON API and serves the embedded web UI. It binds localhost only and defends the no-auth API with Host/Origin checks. Live updates (SSE), search, attachments, and git status are layered on in later milestones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileItem added in v0.5.0

type FileItem struct {
	Path string `json:"path"`
	Kind string `json:"kind"` // "file" | "dir"
}

FileItem is one autocomplete suggestion from /api/files.

type Server

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

Server wires the store into HTTP handlers.

func New

func New(st *store.Store, version string) *Server

New constructs a server over the given store.

func (*Server) Handler

func (srv *Server) Handler() http.Handler

Handler builds the chi router with all routes and middleware.

func (*Server) StartLiveSync

func (srv *Server) StartLiveSync() func()

StartLiveSync begins watching the .pine directory and broadcasting external changes over SSE. It returns a stop function. When the watcher cannot start, the server still runs (without live updates).

Jump to

Keyboard shortcuts

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