How eziokwuche/webhook-relay works
Webhook Relay accepts and validates webhook submissions, persists them as pending events, and asynchronously forwards them with bounded concurrency and retry/backoff handling. The same API also exposes health, event listing, lookup, and aggregate statistics. Source excerpts show the server wiring and runtime calls; the SQL schema and any additional implementation details were not excerpted.
Main entry points: repository.go Event Repository · main.go Server Bootstrap · relay.go Relay Worker · routes.go HTTP Routes
Components 9
HTTP API
- HTTP Routes
internal/api/routes.go - API Handlers
internal/api/handlers.go
Async Delivery
- Relay Worker
internal/worker/relay.go
Persistence
- Event Repository
internal/db/repository.go - PostgreSQL Events
sql/schema.sql - Webhook Event Model
internal/models/event.go
Runtime
- Server Bootstrap
cmd/server/main.go
Other components
- Webhook Sender
- Webhook Target
Connections 10
- Webhook Sender → HTTP Routes: sends requests
README.md - Server Bootstrap → Event Repository: creates
cmd/server/main.go - Server Bootstrap → Relay Worker: starts
cmd/server/main.go - Server Bootstrap → HTTP Routes: serves
cmd/server/main.go - HTTP Routes → API Handlers: routes requests
internal/api/routes.go - API Handlers → Event Repository: reads and writes
internal/api/handlers.go - Event Repository → PostgreSQL Events: queries and updates
internal/db/repository.go - Event Repository → Webhook Event Model: maps rows
internal/db/repository.go - Relay Worker → Event Repository: polls and updates
internal/worker/relay.go - Relay Worker → Webhook Target: POSTs payload
README.md