server

package
v0.0.0-...-e1703fb Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package server exposes the HTTP API for the postmortems site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompanySlug

func CompanySlug(c string) string

CompanySlug turns a company name into a URL-safe slug for /company/{slug}.

func LoadPostmortem

func LoadPostmortem(dir, filename string) (*postmortems.Postmortem, error)

LoadPostmortem reads a single postmortem from dir.

func LoadPostmortems

func LoadPostmortems(dir string) ([]*postmortems.Postmortem, error)

LoadPostmortems reads every postmortem under dir.

func New

func New(opts Options) http.Handler

New returns the HTTP handler, wrapped with otelhttp (excluding /metrics).

Types

type Options

type Options struct {
	Logger         *zap.SugaredLogger
	MetricsHandler http.Handler
	Dir            string
}

Options configures the HTTP router. MetricsHandler is mounted at /metrics.

type PageMeta

type PageMeta struct {
	Path        string
	Title       string
	Description string
	OGType      string // "website" (default) or "article"
}

PageMeta is the per-page SEO/social metadata layout.html consumes as `.Meta`. Path is site-relative; absURL turns it into a full canonical URL.

Jump to

Keyboard shortcuts

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