
Webhook Design for Go APIs That Customers Can Trust
Design webhooks customers can trust in Go: an event envelope, per-endpoint API versions, filters, secret rotation, auto-disable, replay and signing.
Tag
22 articles

Design webhooks customers can trust in Go: an event envelope, per-endpoint API versions, filters, secret rotation, auto-disable, replay and signing.

Build a link preview service in Go that fetches a URL and reads its Open Graph tags, with a dialer that blocks private addresses after DNS to stop SSRF.

Build a reverse proxy in Go with httputil.ReverseProxy: Rewrite instead of Director, forwarded headers, error handling, streaming and path based routing.

Build a WebSocket hub in Go with gorilla/websocket: origin checks, read limits, ping and pong, per client send queues and a rule for slow consumers.

Build a pastebin in Go on SQLite with unguessable IDs, expiry, burn after read that survives link previews, delete tokens and output that cannot run scripts.

Serve interactive API docs from a Go binary: Swagger UI embedded with swgui, the spec via go:embed, a password gate, CSP caveats and a build tag.

Build an admin dashboard in Go with templ, HTMX and Tailwind classes: a shell, stat cards, a sortable paged table, role aware buttons and server side checks.

Run long work behind a Go API with 202 Accepted: a bounded worker pool, a pollable job resource, Retry-After, idempotency keys, cancellation, clean shutdown.

Build a URL shortener in Go on SQLite with random base62 codes, collision retries, custom aliases, expiry, hit counting and tests for the awkward cases.

Build a dashboard in Go with html/template and HTMX: fragments chosen by the HX-Request header, polling cards, filters, a retry button and HX-Trigger.

Build a contacts directory with templ and HTMX: live search, endless scroll, click to edit with validation, delete with an out of band count and fragments.

Build the sending side of webhooks in Go: signed deliveries, a retry schedule that honors Retry-After, permanent versus temporary failures and dead endpoints.