gRPC-Go
Go implementation of gRPC for high-performance RPC over HTTP/2 with streaming and interceptors.
Official Documentation ↗grpc-go 1.63+ / Go 1.20+. Check the official docs for the latest API surface.Installation
go get google.golang.org/grpcMethods
No methods match this filter.
Overview
gRPC-Go implements gRPC over HTTP/2 with protobuf messages, supporting unary and streaming calls, deadlines, metadata and interceptors for cross-cutting concerns.
Core Methods
Generate code from protobuf definitions, implement the service server interface, register it and serve. Clients dial a target and use a generated stub to call methods.
Usage Notes
Set deadlines on every call, use interceptors for auth, logging and metrics, and return status codes rather than raw errors so clients can react correctly.
Common Pitfalls
Insecure credentials in production expose traffic. Missing deadlines let slow downstream calls exhaust resources. A single connection is multiplexed, so per-call timeouts matter more than connection pooling.
FAQ
- How are deadlines handled?
- gRPC propagates deadlines through context. Set a context timeout on the client and check context errors on the server so slow calls do not pile up.
- How do I use TLS or plaintext?
- Production should use transport credentials with TLS. For local development use insecure credentials, but never ship that configuration.
- How do I return rich errors?
- Use status.Error with codes such as InvalidArgument or NotFound and, optionally, error details. Clients inspect codes to branch on failure type.
Report a problem with this API docOpens a pre-filled issue on GitHub.