Documentation
¶
Overview ¶
Package app is the composition root (Option C): the ONLY place that wires domains, platform, and modes together. cmd/watchpost stays thin.
RunDashboard wires the live pipeline (B3): config locations → NWS provider → tiered scheduler → published snapshots streamed into the TTY dashboard. M1 instrumentation: the time from start to the first fully-populated snapshot is logged to stderr on exit when WATCHPOST_DEBUG_TIMING=1.
Setup (UAT 100, HUM LEAD 2026-08-25): the first-run questions live in a window over the dashboard like every other modal (modes/tty setupLines); this file is the app side — the type-ahead hook and the persist step. Re-runs never destroy customizations (B2 red-team #2): the existing config is loaded and only what setup owns is touched — the default location and, when given, the FIRMS key.
Index ¶
- Constants
- func RenderCast(ctx context.Context) string
- func ReportOnce(ctx context.Context, query string) (*snapshot.Snapshot, error)
- func ReportOnceWithStats(ctx context.Context, query string) (*snapshot.Snapshot, httpx.RequestStats, error)
- func RunDashboard(version string, opt Options) error
- type CastReport
- type CastRow
- type Gauge
- type Options
- type SourceHealth
Constants ¶
const UserAgent = "watchpost (+https://github.com/branden-thompson/watchpost)"
UserAgent identifies watchpost to providers (AI-1: NWS requires contact info; a reachable project URL satisfies it). The tree is public, so no personal address rides here.
NO VERSION. A version in the header is a fact about this machine that no provider asks for, and one more thing to keep in step with the build — it read 0.9 for five releases. The project URL is the contact NWS wants.
Variables ¶
This section is empty.
Functions ¶
func RenderCast ¶ added in v0.14.0
RenderCast is `watchpost report --verbose`'s cast block: who reads what on this machine and why, and the tone state — the same answers [S] gives, with no deck and no dashboard (Task 4.8).
A config that will not load is reported as such rather than skipped: a listener running --verbose because something is wrong needs to be told when the file itself is the something.
func ReportOnce ¶
ReportOnce runs the one-shot fetch pipeline for `watchpost report <query>`: resolve the location, fetch obs+forecast+alerts from NWS, and return the published snapshot (B1a scope; scheduler-driven live mode arrives B1b/B3).
func ReportOnceWithStats ¶ added in v0.9.5
func ReportOnceWithStats(ctx context.Context, query string) (*snapshot.Snapshot, httpx.RequestStats, error)
ReportOnceWithStats is ReportOnce plus the request counters of the clients the run used (`report --verbose`, quality pass Q0).
func RunDashboard ¶
RunDashboard starts the live TUI. Returns after the user quits.
Types ¶
type CastReport ¶ added in v0.14.0
CastReport is the whole answer — the cast rows, the tone state and the problems — built from a config and a host, with no deck anywhere.
func (CastReport) ToneSummary ¶ added in v0.14.0
func (r CastReport) ToneSummary() string
ToneSummary words the tone state for a listener: "all tones on", "muted", or "muted: watches, advisories".
type CastRow ¶ added in v0.14.0
type CastRow struct {
Role string
Requested string
Spoken string
Link string
Reason string
Installing bool // a named Piper key that is not on disk yet
}
CastRow is one role's answer, ready to print: who was asked for, who speaks, which link won, and why the requested one lost.
type Gauge ¶ added in v0.9.5
Gauge is one structure's size at a point in time. Len counts items; Bytes is the payload size when the owner can say it cheaply, else 0.
type Options ¶ added in v0.9.6
type Options struct {
OpenSetup bool // open the Setup window at once (`watchpost setup`); it also opens itself on a first run or an empty watchlist (UAT 100)
ASCII bool // --ascii: row marks and legend in their ASCII forms (A11-10)
}
Options are the dashboard's launch switches.
type SourceHealth ¶ added in v0.13.0
type SourceHealth struct {
Name string
OK bool
FetchedAt time.Time // the last successful fetch; zero = never
}
SourceHealth is one feed's last outcome, for the window's "Updated" stamp and its source line: a dead source must show, and the stamp is the newest successful fetch — dataAsOf — never the publish time.
Source Files
¶
- air_boundary.go
- airscope.go
- alert_store.go
- app.go
- bedfence.go
- bedrelay.go
- burst_words.go
- cast.go
- compose_takeover.go
- credits.go
- dashboard.go
- debug.go
- director.go
- dump.go
- dump_unix.go
- endpoints.go
- eventrecord.go
- every.go
- executors.go
- fire.go
- framelog.go
- history.go
- hostfacts.go
- inject.go
- lazymemo.go
- livesource.go
- mainread.go
- maintrack.go
- mapairuv.go
- mapfeed.go
- mapfire.go
- mapgeometry.go
- mapinview.go
- maplayers.go
- mapmarine.go
- mapnames.go
- mapproblems.go
- mapquakes.go
- mapradar.go
- maprain.go
- maps.go
- maptemp.go
- maptiles.go
- mapwaves.go
- marine.go
- mastercontrol.go
- metro.go
- pipelines.go
- pool.go
- pump.go
- radio.go
- radio_queue.go
- read_script.go
- refs.go
- release.go
- resolve.go
- rotation_script.go
- schedule.go
- seen_store.go
- seismic.go
- setup.go
- severe.go
- severe_read.go
- shared.go
- stationrecord.go
- stats.go
- themes.go
- ticker.go
- timing.go
- uvknown.go
- voices.go