Documentation
¶
Overview ¶
Package server exposes RunLore's HTTP endpoints (incident webhooks).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct {
Approvals *action.Approvals
Pauser Pauser
Token string
SlackSecret string
WebhookToken string // optional bearer token required on POST /webhook/alertmanager
ApproverIDs []string // Slack user IDs permitted to approve actions
Feedback FeedbackRecorder // nil unless an outcome ledger is configured; records unprivileged 👍/👎 clicks
}
Actions bundles the optional rung-2/rung-3 wiring: the approval queue, the auto kill-switch, the shared control token, and the Slack signing secret.
type FeedbackRecorder ¶ added in v0.5.0
type FeedbackRecorder interface {
Feedback(triggerKey, fingerprint, rating string, at time.Time) error
}
FeedbackRecorder persists a human 👍/👎 on a delivered investigation (implemented by *outcome.Ledger).
type Pauser ¶
type Pauser interface {
Pause()
Resume()
Paused() bool
}
Pauser is the rung-3 auto-execution kill-switch.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles incoming incident webhooks and applies the trigger policy.
func New ¶
func New(ready func() bool, acts Actions, built []source.Built, pipe *source.Pipeline, metricsHandler http.Handler, log *slog.Logger) *Server
New builds a Server. ready reports whether this replica should serve; nil = always ready. The caller composes what readiness means (e.g. leadership AND a warm catalog). acts (optional) enables the rung-2 approval endpoints + the rung-3 kill-switch, gated by acts.Token (X-Approval-Token). /healthz is liveness; /readyz is readiness (gated by the caller-supplied ready func). built + pipe wire the registered event sources: webhook sources are mounted at their paths and feed the ingest pipeline. metricsHandler (optional) serves OTel Prometheus metrics on GET /metrics when non-nil.