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
}
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 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(cfg *config.Config, enq investigate.Enqueuer, ready func() bool, acts Actions, 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). metricsHandler (optional) serves OTel Prometheus metrics on GET /metrics when non-nil.
func (*Server) Handler ¶
Handler returns the HTTP handler (built once at construction; Go 1.22+ method routing).
func (*Server) SetCoalescer ¶
SetCoalescer attaches a Coalescer after construction. Call before accepting requests; nil cz disables coalescing (direct enqueue).
func (*Server) SetMetrics ¶
SetMetrics attaches the OTel metrics instance independently of coalescing, so ingress counters (alerts_received) emit even when coalescing is disabled.
func (*Server) SetOutcomeLedger ¶
SetOutcomeLedger attaches the outcome ledger; resolved alerts are recorded into it.