• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H12-Aug-2021-349279

Documentation/H12-Aug-2021-1,026751

admin/H12-Aug-2021-247117

attributes/H12-Aug-2021-14167

authz/H12-Aug-2021-531458

backoff/H12-Aug-2021-5314

balancer/H12-Aug-2021-11,7638,366

benchmark/H12-Aug-2021-5,4674,074

binarylog/H12-Aug-2021-2,3211,846

channelz/H12-Aug-2021-6,0114,936

cmd/protoc-gen-go-grpc/H12-Aug-2021-566446

codes/H12-Aug-2021-402170

connectivity/H12-Aug-2021-6430

credentials/H12-Aug-2021-12,4838,643

encoding/H12-Aug-2021-562307

examples/H12-Aug-2021-9,0146,601

grpclog/H12-Aug-2021-729397

health/H12-Aug-2021-1,014664

internal/H12-Aug-2021-29,83321,565

interop/H12-Aug-2021-11,5429,261

keepalive/H12-Aug-2021-8620

metadata/H12-Aug-2021-549380

peer/H12-Aug-2021-5218

profiling/H12-Aug-2021-1,7101,222

reflection/H12-Aug-2021-4,0693,199

resolver/H12-Aug-2021-422130

security/H12-Aug-2021-7,3636,017

serviceconfig/H12-Aug-2021-4511

stats/H12-Aug-2021-1,7581,365

status/H12-Aug-2021-587441

stress/H12-Aug-2021-1,024785

tap/H12-Aug-2021-578

test/H12-Aug-2021-18,40114,750

testdata/H12-Aug-2021-1,071985

xds/H12-Aug-2021-46,68534,544

AUTHORSH A D12-Aug-202112 21

CODE-OF-CONDUCT.mdH A D12-Aug-2021138 42

CONTRIBUTING.mdH A D12-Aug-20213 KiB6246

GOVERNANCE.mdH A D12-Aug-2021141 21

LICENSEH A D12-Aug-202111.1 KiB203169

MAINTAINERS.mdH A D12-Aug-20211.3 KiB2824

MakefileH A D12-Aug-2021938 4937

README.mdH A D12-Aug-20214.7 KiB142101

SECURITY.mdH A D12-Aug-2021202 42

backoff.goH A D12-Aug-20211.9 KiB6215

balancer_conn_wrappers.goH A D12-Aug-20217.4 KiB268195

balancer_switching_test.goH A D12-Aug-202118.2 KiB587442

call.goH A D12-Aug-20212.4 KiB7536

call_test.goH A D12-Aug-202114.8 KiB502432

clientconn.goH A D12-Aug-202149.9 KiB1,5901,138

clientconn_state_transition_test.goH A D12-Aug-202112.6 KiB506392

clientconn_test.goH A D12-Aug-202132.4 KiB1,115930

codec.goH A D12-Aug-20211.6 KiB5116

codec_test.goH A D12-Aug-2021895 3311

codegen.shH A D12-Aug-2021635 182

dialoptions.goH A D12-Aug-202121.1 KiB623299

doc.goH A D12-Aug-2021786 271

go.modH A D12-Aug-2021642 1916

go.sumH A D12-Aug-202112.4 KiB129128

grpc_test.goH A D12-Aug-2021780 3411

install_gae.shH A D12-Aug-2021235 64

interceptor.goH A D12-Aug-20215.2 KiB10220

picker_wrapper.goH A D12-Aug-20214.7 KiB178122

picker_wrapper_test.goH A D12-Aug-20214.8 KiB156120

pickfirst.goH A D12-Aug-20213.9 KiB137100

pickfirst_test.goH A D12-Aug-202111.6 KiB349276

preloader.goH A D12-Aug-20211.9 KiB6834

regenerate.shH A D12-Aug-20214.7 KiB12070

resolver_conn_wrapper.goH A D12-Aug-20215.9 KiB188143

resolver_conn_wrapper_test.goH A D12-Aug-20214 KiB12787

rpc_util.goH A D12-Aug-202127.8 KiB917522

rpc_util_test.goH A D12-Aug-20217.4 KiB269207

server.goH A D12-Aug-202156.8 KiB1,8781,347

server_test.goH A D12-Aug-20214.6 KiB190148

service_config.goH A D12-Aug-202111.8 KiB405283

service_config_test.goH A D12-Aug-202110.1 KiB512466

stream.goH A D12-Aug-202147.8 KiB1,6141,158

trace.goH A D12-Aug-20212.9 KiB12478

trace_test.goH A D12-Aug-20211.2 KiB5129

version.goH A D12-Aug-2021683 232

vet.shH A D12-Aug-20216.5 KiB216157

README.md

1# gRPC-Go
2
3[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go)
4[![GoDoc](https://pkg.go.dev/badge/google.golang.org/grpc)][API]
5[![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go)
6
7The [Go][] implementation of [gRPC][]: A high performance, open source, general
8RPC framework that puts mobile and HTTP/2 first. For more information see the
9[Go gRPC docs][], or jump directly into the [quick start][].
10
11## Prerequisites
12
13- **[Go][]**: any one of the **three latest major** [releases][go-releases].
14
15## Installation
16
17With [Go module][] support (Go 1.11+), simply add the following import
18
19```go
20import "google.golang.org/grpc"
21```
22
23to your code, and then `go [build|run|test]` will automatically fetch the
24necessary dependencies.
25
26Otherwise, to install the `grpc-go` package, run the following command:
27
28```console
29$ go get -u google.golang.org/grpc
30```
31
32> **Note:** If you are trying to access `grpc-go` from **China**, see the
33> [FAQ](#FAQ) below.
34
35## Learn more
36
37- [Go gRPC docs][], which include a [quick start][] and [API
38  reference][API] among other resources
39- [Low-level technical docs](Documentation) from this repository
40- [Performance benchmark][]
41- [Examples](examples)
42
43## FAQ
44
45### I/O Timeout Errors
46
47The `golang.org` domain may be blocked from some countries. `go get` usually
48produces an error like the following when this happens:
49
50```console
51$ go get -u google.golang.org/grpc
52package 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)
53```
54
55To build Go code, there are several options:
56
57- Set up a VPN and access google.golang.org through that.
58
59- Without Go module support: `git clone` the repo manually:
60
61  ```sh
62  git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
63  ```
64
65  You will need to do the same for all of grpc's dependencies in `golang.org`,
66  e.g. `golang.org/x/net`.
67
68- With Go module support: it is possible to use the `replace` feature of `go
69  mod` to create aliases for golang.org packages.  In your project's directory:
70
71  ```sh
72  go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest
73  go mod tidy
74  go mod vendor
75  go build -mod=vendor
76  ```
77
78  Again, this will need to be done for all transitive dependencies hosted on
79  golang.org as well. For details, refer to [golang/go issue #28652](https://github.com/golang/go/issues/28652).
80
81### Compiling error, undefined: grpc.SupportPackageIsVersion
82
83#### If you are using Go modules:
84
85Ensure your gRPC-Go version is `require`d at the appropriate version in
86the same module containing the generated `.pb.go` files.  For example,
87`SupportPackageIsVersion6` needs `v1.27.0`, so in your `go.mod` file:
88
89```go
90module <your module name>
91
92require (
93    google.golang.org/grpc v1.27.0
94)
95```
96
97#### If you are *not* using Go modules:
98
99Update the `proto` package, gRPC package, and rebuild the `.proto` files:
100
101```sh
102go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
103go get -u google.golang.org/grpc
104protoc --go_out=plugins=grpc:. *.proto
105```
106
107### How to turn on logging
108
109The default logger is controlled by environment variables. Turn everything on
110like this:
111
112```console
113$ export GRPC_GO_LOG_VERBOSITY_LEVEL=99
114$ export GRPC_GO_LOG_SEVERITY_LEVEL=info
115```
116
117### The RPC failed with error `"code = Unavailable desc = transport is closing"`
118
119This error means the connection the RPC is using was closed, and there are many
120possible reasons, including:
121 1. mis-configured transport credentials, connection failed on handshaking
122 1. bytes disrupted, possibly by a proxy in between
123 1. server shutdown
124 1. Keepalive parameters caused connection shutdown, for example if you have configured
125    your server to terminate connections regularly to [trigger DNS lookups](https://github.com/grpc/grpc-go/issues/3170#issuecomment-552517779).
126    If this is the case, you may want to increase your [MaxConnectionAgeGrace](https://pkg.go.dev/google.golang.org/grpc/keepalive?tab=doc#ServerParameters),
127    to allow longer RPC calls to finish.
128
129It can be tricky to debug this because the error happens on the client side but
130the root cause of the connection being closed is on the server side. Turn on
131logging on __both client and server__, and see if there are any transport
132errors.
133
134[API]: https://pkg.go.dev/google.golang.org/grpc
135[Go]: https://golang.org
136[Go module]: https://github.com/golang/go/wiki/Modules
137[gRPC]: https://grpc.io
138[Go gRPC docs]: https://grpc.io/docs/languages/go
139[Performance benchmark]: https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5180705743044608
140[quick start]: https://grpc.io/docs/languages/go/quickstart
141[go-releases]: https://golang.org/doc/devel/release.html
142