web

package
v0.0.315 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package web is satelle's push-fed read-only web UI (mirror server). The live verb-dispatch Server (web.New) was removed in sty_80233c10 — production uses NewMirror only. Shared view-model types and pure helpers stay here with the embedded static assets and templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MirrorDefaultPath added in v0.0.280

func MirrorDefaultPath() string

MirrorDefaultPath is a convenience for tests.

func RequestLog added in v0.0.108

func RequestLog(next http.Handler, logPath string, cfg logfile.Config) http.Handler

RequestLog wraps next so every request appends one grep-friendly line to the server log at logPath through the shared rotating writer (internal/logfile), with the same daily+size rotation as the other flat evidence logs. Best-effort: a log write never affects the response. It is wired at the serve listener (not web.New), so httptest servers stay log-free and each serve process logs to its own repo's .satelle/logs/server.log.

Line: <rfc3339>\t<LEVEL>\t<method>\t<path>\t<status>\t<duration_ms>[\t<note>]. LEVEL is INFO, WARN when slow (SSE /events exempt — it is open for its lifetime), or ERROR for status >= 500 or a recovered panic. Only r.URL.Path is logged (no query string) to keep lines short and avoid logging anything sensitive-ish.

http.ErrAbortHandler is re-panicked (not recovered), so the net/http server aborts and closes the connection as designed — recovering it would return a mid-stream (aborted-SSE) connection to the keep-alive pool, hanging the next request that reuses it (sty_fa24469a).

func SetBasePath added in v0.0.9

func SetBasePath(p string)

SetBasePath sets the mount prefix (trailing slash trimmed). Call before New.

Types

type MirrorServer added in v0.0.280

type MirrorServer struct {
	Handler http.Handler
	Store   *mirror.Store
	// InstanceID is exposed on GET /healthz as X-Satelle-Instance so CLI
	// auto-bootstrap only seeds a serve that matches the caller's SATELLE_HOME
	// (sty_5aa08259 / epic:mirror-hygiene).
	InstanceID string
	// contains filtered or unexported fields
}

MirrorServer is the push-fed read-only UI (sty_dbdadfa0 + epic:mirror-ui-parity). It never opens a per-repo runtime DB; all product state comes from the mirror store.

func NewMirror added in v0.0.280

func NewMirror(m *mirror.Store) *MirrorServer

NewMirror builds the RO+ingest HTTP surface over m. Instance identity is derived from the process GlobalDir (same home as the mirror DB path).

func NewMirrorWithInstance added in v0.0.292

func NewMirrorWithInstance(m *mirror.Store, instanceID string) *MirrorServer

NewMirrorWithInstance is like NewMirror but sets an explicit instance id (tests inject a fixed id; production uses CurrentInstanceID).

func (*MirrorServer) Publish added in v0.0.280

func (s *MirrorServer) Publish(topic string)

Publish rings SSE (ingest already does this via OnChange).

Jump to

Keyboard shortcuts

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