Documentation
¶
Overview ¶
dependency wiring, and control-plane serving in one process seam.
Package bootstrap wires the local Swobu runtime.
It owns startup composition for the daemon process boundary: config loading, dependency wiring, listener startup, and the minimal runtime status truth the rest of the process can query.
Bootstrap also composes embedded telemetry runtime export as a downstream consumer of traffic evidence append events (plus local install state) rather than a request-path control input. It does not own HTTP rendering, domain rules, or provider dialect behavior.
Index ¶
- type Daemon
- func (d *Daemon) Addr() string
- func (d *Daemon) BaseURL() string
- func (d *Daemon) Close() error
- func (d *Daemon) Status() (Status, error)
- func (d *Daemon) StatusProjectionForScope(scope trafficevidencestore.ProjectionScope) (trafficevidencestore.StatusProjection, error)
- func (d *Daemon) Wait(ctx context.Context) error
- type HealthState
- type StartInput
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the live process boundary produced by bootstrap. It owns listener lifetime, runtime health, and graceful shutdown for the local daemon.
Close owns cleanup: it drives http.Server.Shutdown (which stops accepting and waits for active handlers to finish before returning), then stops telemetry and closes the config store. Cleanup therefore never overlaps an in-flight request. There is no retryable shutdown state machine and no force-close mode: a handler that ignores cancellation will block Close, which is the process supervisor's boundary to break. Close runs once and returns the cached terminal result.
func Start ¶
func Start(ctx context.Context, in StartInput) (*Daemon, error)
operator routes, and request-path dependencies in one bootstrap flow.
func (*Daemon) Close ¶
Close stops request serving before closing request-owned dependencies. Shutdown stops accepting and waits for active handlers to finish; only then are telemetry and the config store closed. It runs once and returns the cached terminal result (the join of shutdown, serve, and cleanup errors).
func (*Daemon) StatusProjectionForScope ¶
func (d *Daemon) StatusProjectionForScope(scope trafficevidencestore.ProjectionScope) (trafficevidencestore.StatusProjection, error)
type HealthState ¶
type HealthState string
const ( HealthStateUninitialized HealthState = "uninitialized" HealthStateHealthy HealthState = "healthy" HealthStateDegraded HealthState = "degraded" )
type StartInput ¶
type StartInput struct {
ConfigPath string
StartupConfig config.StartupConfig
Providers provider.BackendResolver
TargetSupport provider.TargetSupportResolver
ModelCatalog provider.Discovery
TrafficEventSink observation.TrafficEventSink
Logger *slog.Logger
}
StartInput collects the one runtime config path plus the dependencies bootstrap must wire into the live request path.
type Status ¶
type Status struct {
State HealthState `json:"state"`
WorkspaceCount int `json:"workspace_count"`
}
Status is the first machine-readable runtime health projection. CLI and TUI surfaces can render or relay it without re-deriving state from prose.