- Notifications
You must be signed in to change notification settings - Fork4.6k
The Go language implementation of gRPC. HTTP/2 based RPC
License
grpc/grpc-go
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TheGo implementation ofgRPC: A high performance, open source, generalRPC framework that puts mobile and HTTP/2 first. For more information see theGo gRPC docs, or jump directly into thequick start.
Simply add the following import to your code, and thengo [build|run|test]will automatically fetch the necessary dependencies:
import"google.golang.org/grpc"
Note: If you are trying to access
grpc-gofromChina, see theFAQ below.
- Go gRPC docs, which include aquick start andAPIreference among other resources
- Low-level technical docs from this repository
- Performance benchmark
- Examples
- Contribution guidelines
Thegolang.org domain may be blocked from some countries.go get usuallyproduces an error like the following when this happens:
$go get -u google.golang.org/grpcpackage google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
To build Go code, there are several options:
Set up a VPN and access google.golang.org through that.
With Go module support: it is possible to use the
replacefeature ofgo modto create aliases for golang.org packages. In your project's directory:go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latestgo mod tidygo mod vendorgo build -mod=vendor
Again, this will need to be done for all transitive dependencies hosted ongolang.org as well. For details, refer togolang/go issue#28652.
Please update to the latest version of gRPC-Go usinggo get google.golang.org/grpc.
The default logger is controlled by environment variables. Turn everything onlike this:
$export GRPC_GO_LOG_VERBOSITY_LEVEL=99$export GRPC_GO_LOG_SEVERITY_LEVEL=info
This error means the connection the RPC is using was closed, and there are manypossible reasons, including:
- mis-configured transport credentials, connection failed on handshaking
- bytes disrupted, possibly by a proxy in between
- server shutdown
- Keepalive parameters caused connection shutdown, for example if you haveconfigured your server to terminate connections regularly totrigger DNSlookups.If this is the case, you may want to increase yourMaxConnectionAgeGrace,to allow longer RPC calls to finish.
It can be tricky to debug this because the error happens on the client side butthe root cause of the connection being closed is on the server side. Turn onlogging onboth client and server, and see if there are any transporterrors.
About
The Go language implementation of gRPC. HTTP/2 based RPC
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.