server

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

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(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.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler (built once at construction; Go 1.22+ method routing).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL