transport¶
A framework-free HTTP, gRPC and gateway server stack for Go: hardened server
constructors, health/liveness/readiness endpoints, request and RPC authentication, and
security headers, built on go/controls, go/authn, go/transit and go/tls.
gitlab.com/phpboyscout/go/transport is the server half of the transport stack
extracted from go-tool-base. It gives a
service an HTTP server, a gRPC server or both, with health probes, TLS,
authentication and security headers wired in and lifecycle handled by go/controls,
without a CLI framework in tow. Three sub-packages, composed as you need them:
transport/http: the hardened*http.Server:HealthHandler/LivenessHandler/ReadinessHandler,NewServerfrom typedServerSettings,AuthMiddleware,SecurityHeadersMiddleware, andStartWithTLSPair/Stop/Statusglue forgo/controls.transport/grpc: the hardened*grpc.Server:NewServer,RegisterHealthService,AuthInterceptor, TLS server/client credentials,DialLocal, and the same lifecycle glue.transport/gateway: a grpc-gateway exposing a gRPC service over REST/JSON.
Why¶
- Framework-free. It depends on
go/controls (lifecycle),
go/authn,
go/transit (middleware),
go/tls,
go/grpcclient,
go/redact,
go/errors, the
gRPC SDK and the grpc-gateway runtime, but not on go-tool-base or the
CLI/config/TUI stack. A
depfootprinttest enforces that boundary. - Secure by default. Hardened TLS, bounded timeouts, health endpoints mounted
outside the auth chain on the
Registerpath, security headers and credential-redacting auth. - The middleware is transit's. Request logging, OpenTelemetry, circuit breaking and
rate limiting are the
go/transitserver middleware; this stack composes them.
Where next¶
- Getting started: a health-checked HTTP + gRPC service in a few lines.
- Add auth, security headers & a gateway: compose the server building blocks.
- Reference: every setting, option and default, and what happens when one is wrong.
- What transport does not do: the deliberate gaps, and which module fills each one.
- The server/client split & the lifecycle seam: why the servers live here and the config adapters stay in the framework.
- API reference: full godoc on pkg.go.dev.
Part of the phpboyscout Go toolkit: small, framework-free Go modules extracted from go-tool-base.
Further reading¶
The blog carries a curated route through this subject: Building a web service in Go collects everything written about it, ordered so you can start at the beginning rather than newest-first.
Ask phpbotscout

He answers questions about the projects over on the Discord, citing the docs where they already cover it, and offering to raise an issue where they don't. Bring a bug, an idea, or a questionable engineering decision.