Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
go-japi
Japi is a fast & simple HTTP API library that automatically marshals JSON payloads and uses RFC7807 for problem details
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Connect is based on net/http, is fully gRPC-compatible (including streaming, trailers, and error details), and is just one Go package. Connect clients work with any gRPC server, and Connect handlers work with any gRPC client. Handlers implement http.Handler and clients wrap http.Client, so Connect works with the whole Go HTTP ecosystem.
For more details, check out the launch blog post, the documentation, connect-go on Github, or the demo project.
The generic request and response wrappers seem interesting but they do tend to make the handler signature very verbose with little upside. For example: `type Handle[T any, O any] func(ctx context.Context, request T) (O, error)` would be really sweet. See go-japi for example.
To appreciate just how complicated putting headers on the context is, check out grpc-go's documentation on metadata, and note how particular you need to be about inbound vs outbound metadata. They've really thought this through, and I don't see a substantially better way to design a context-based system.