transport¶
A framework-free HTTP + gRPC + gateway server stack for Go — hardened server
constructors, health/liveness/readiness endpoints, request/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 a secure, lifecycle-managed HTTP and/or gRPC server — with health probes, TLS,
authentication and security headers wired in — 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, andStart/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 the transport essentials —
go/controls (lifecycle),
go/authn,
go/transit (middleware),
go/tls, the gRPC SDK and the grpc-gateway runtime —
but not go-tool-base or the CLI/config/TUI stack. A
depfootprintguard enforces that boundary. - Secure by default. Hardened TLS, bounded timeouts, health endpoints mounted outside the auth chain, security headers and credential-redacting auth ship ready to use.
- 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.
- 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.