Documentation
¶
Index ¶
- func SPA(spaFS fs.FS, routePrefix string) http.HandlerFunc
- type API
- func (a *API) Config() http.HandlerFunc
- func (a *API) Healthz() http.HandlerFunc
- func (a *API) Heartbeat() http.HandlerFunc
- func (a *API) HeartbeatsSum() http.HandlerFunc
- func (a *API) HistoryAll() http.HandlerFunc
- func (a *API) HistoryByHeartbeat() http.HandlerFunc
- func (a *API) HistoryRecorder() history.Recorder
- func (a *API) Metrics() http.Handler
- func (a *API) ReceiversSum() http.HandlerFunc
- func (a *API) ReloadHandler() http.Handler
- func (a *API) SetHistory(h history.Recorder)
- func (a *API) SetHub(hub *ws.Hub)
- func (a *API) SetMetrics(m *metrics.Registry)
- func (a *API) SetReloadFn(fn func() error)
- func (a *API) SetService(s ServiceProvider)
- func (a *API) Status() http.HandlerFunc
- func (a *API) StatusAll() http.HandlerFunc
- func (a *API) WS() http.HandlerFunc
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Version string // Build version string.
Commit string // Build commit string.
SiteURL string // Site root URL.
Logger *slog.Logger // Logger for access/system logs.
// contains filtered or unexported fields
}
API bundles shared handler dependencies and runtime configuration.
func (*API) Config ¶ added in v0.22.0
func (a *API) Config() http.HandlerFunc
Config returns runtime configuration for the SPA.
func (*API) Healthz ¶
func (a *API) Healthz() http.HandlerFunc
Healthz returns the HTTP handler for the /healthz endpoint.
func (*API) Heartbeat ¶ added in v0.22.0
func (a *API) Heartbeat() http.HandlerFunc
Heartbeat receives heartbeat pings for a specific heartbeat id.
func (*API) HeartbeatsSum ¶ added in v0.22.0
func (a *API) HeartbeatsSum() http.HandlerFunc
Heartbeats returns a list of configured heartbeats for the UI.
func (*API) HistoryAll ¶ added in v0.22.0
func (a *API) HistoryAll() http.HandlerFunc
HistoryAll returns all recorded history items.
func (*API) HistoryByHeartbeat ¶ added in v0.22.0
func (a *API) HistoryByHeartbeat() http.HandlerFunc
HistoryByHeartbeat returns recorded history items filtered by heartbeat id.
func (*API) HistoryRecorder ¶ added in v0.22.0
HistoryRecorder returns the configured history recorder.
func (*API) ReceiversSum ¶ added in v0.22.0
func (a *API) ReceiversSum() http.HandlerFunc
Receivers returns a list of receivers for the UI.
func (*API) ReloadHandler ¶
ReloadHandler triggers a config reload.
func (*API) SetHistory ¶ added in v0.22.0
SetHistory attaches a history recorder
func (*API) SetMetrics ¶ added in v0.22.0
SetMetrics attaches a metrics registry
func (*API) SetReloadFn ¶ added in v0.22.0
SetReloadFn attaches a reload function to the API.
func (*API) SetService ¶ added in v0.22.0
func (a *API) SetService(s ServiceProvider)
SetService attaches a heartbeat service
func (*API) Status ¶ added in v0.22.0
func (a *API) Status() http.HandlerFunc
Status returns a status snapshot of the heartbeat receiver.
func (*API) StatusAll ¶ added in v0.22.0
func (a *API) StatusAll() http.HandlerFunc
Status returns a status snapshot of the heartbeat receiver.
func (*API) WS ¶ added in v0.22.0
func (a *API) WS() http.HandlerFunc
WS streams heartbeat updates over a websocket connection.
type ServiceProvider ¶ added in v0.22.0
type ServiceProvider interface {
HeartbeatSummaries() []service.HeartbeatSummary
ReceiverSummaries() []service.ReceiverSummary
Update(id string, payload string, now time.Time) error
StatusAll() []service.Status
StatusByID(id string) (service.Status, error)
}
ServiceProvider exposes the subset of the heartbeat service used by handlers.