Documentation
¶
Overview ¶
Package app is beacon's composition root: it owns the store, bus manager, data server, supervisor, and admin HTTP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is a running beacon instance: store, bus manager, data server, supervisor, and admin HTTP server, all started by Run and torn down by Close.
func Run ¶
Run opens the store, seeds it if requested, starts the bus manager and data server, performs an initial supervisor reconcile, and starts the admin HTTP server (/health, /metrics, /api/, /mcp). It returns once everything is listening.
Components started by the supervisor's reconcile run on the supervisor's own background context, not ctx: ctx only bounds the Run call itself (the store open, the seed, the initial reconcile, and the admin listener bind). Call (*App).Close to stop everything Run started.
func (*App) AdminAddr ¶
AdminAddr returns the bound address of the admin server (/health, /metrics, /api/, /mcp).
func (*App) Close ¶
Close shuts the admin server down, stops the supervisor (which stops every running connector, sink, and source and flushes final queue checkpoints), stops the data server (unblocking any live SSE/WS streams), and closes the store. It is idempotent; concurrent or repeated callers receive the result of the first teardown.
func (*App) Reconcile ¶
Reconcile re-converges running components with stored config (Phase 2 API hook: hot config apply will call this after writing to the store).
type Options ¶
type Options struct {
DBPath string
DataAddr string
AdminAddr string
SeedPath string
Version string // embedded in the config API's OpenAPI document; defaults to "dev"
Log *slog.Logger
N2KBus n2k.Bus
ExtraN2KOpts []n2k.Option
}
Options configures a Run. DBPath, DataAddr, and AdminAddr are required; SeedPath, Version, N2KBus (simulation/embedding), and ExtraN2KOpts are optional.