|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| .github/ | H | 22-May-2019 | - | 52 | 32 |
| Documentation/ | H | 22-May-2019 | - | 1,125 | 815 |
| balancer/ | H | 22-May-2019 | - | 23,784 | 19,280 |
| benchmark/ | H | 22-May-2019 | - | 8,984 | 7,062 |
| binarylog/grpc_binarylog_v1/ | H | 22-May-2019 | - | 901 | 708 |
| channelz/ | H | 22-May-2019 | - | 4,908 | 4,041 |
| codes/ | H | 22-May-2019 | - | 347 | 163 |
| connectivity/ | H | 22-May-2019 | - | 74 | 34 |
| credentials/ | H | 22-May-2019 | - | 6,554 | 4,606 |
| encoding/ | H | 22-May-2019 | - | 577 | 332 |
| examples/ | H | 22-May-2019 | - | 7,853 | 5,769 |
| grpclog/ | H | 22-May-2019 | - | 559 | 294 |
| health/ | H | 22-May-2019 | - | 804 | 516 |
| internal/ | H | 22-May-2019 | - | 15,748 | 11,894 |
| interop/ | H | 22-May-2019 | - | 2,972 | 2,438 |
| keepalive/ | H | 22-May-2019 | - | 86 | 20 |
| metadata/ | H | 22-May-2019 | - | 461 | 318 |
| naming/ | H | 22-May-2019 | - | 696 | 507 |
| peer/ | H | 22-May-2019 | - | 52 | 18 |
| reflection/ | H | 22-May-2019 | - | 3,303 | 2,668 |
| resolver/ | H | 22-May-2019 | - | 2,037 | 1,586 |
| stats/ | H | 22-May-2019 | - | 2,079 | 1,622 |
| status/ | H | 22-May-2019 | - | 560 | 434 |
| stress/ | H | 22-May-2019 | - | 905 | 719 |
| tap/ | H | 22-May-2019 | - | 52 | 8 |
| test/ | H | 22-May-2019 | - | 14,325 | 11,865 |
| testdata/ | H | 22-May-2019 | - | 93 | 63 |
| .travis.yml | H A D | 22-May-2019 | 1.1 KiB | 40 | 34 |
| AUTHORS | H A D | 22-May-2019 | 12 | 2 | 1 |
| CONTRIBUTING.md | H A D | 22-May-2019 | 2.8 KiB | 61 | 45 |
| LICENSE | H A D | 22-May-2019 | 11.1 KiB | 203 | 169 |
| Makefile | H A D | 22-May-2019 | 1 KiB | 61 | 46 |
| README.md | H A D | 22-May-2019 | 4.1 KiB | 122 | 90 |
| backoff.go | H A D | 22-May-2019 | 1.1 KiB | 39 | 10 |
| balancer.go | H A D | 22-May-2019 | 10.9 KiB | 392 | 268 |
| balancer_conn_wrappers.go | H A D | 22-May-2019 | 8 KiB | 316 | 239 |
| balancer_switching_test.go | H A D | 22-May-2019 | 15.8 KiB | 517 | 394 |
| balancer_test.go | H A D | 22-May-2019 | 24.2 KiB | 796 | 659 |
| balancer_v1_wrapper.go | H A D | 22-May-2019 | 8.8 KiB | 335 | 267 |
| call.go | H A D | 22-May-2019 | 2.4 KiB | 75 | 36 |
| call_test.go | H A D | 22-May-2019 | 14.3 KiB | 490 | 421 |
| clientconn.go | H A D | 22-May-2019 | 43.4 KiB | 1,424 | 1,052 |
| clientconn_state_transition_test.go | H A D | 22-May-2019 | 12.8 KiB | 514 | 398 |
| clientconn_test.go | H A D | 22-May-2019 | 39.1 KiB | 1,365 | 1,155 |
| codec.go | H A D | 22-May-2019 | 1.6 KiB | 51 | 16 |
| codec_test.go | H A D | 22-May-2019 | 895 | 33 | 11 |
| codegen.sh | H A D | 22-May-2019 | 635 | 18 | 2 |
| dialoptions.go | H A D | 22-May-2019 | 19 KiB | 559 | 293 |
| doc.go | H A D | 22-May-2019 | 755 | 25 | 1 |
| go.mod | H A D | 22-May-2019 | 828 | 21 | 19 |
| go.sum | H A D | 22-May-2019 | 3.3 KiB | 36 | 35 |
| grpc_test.go | H A D | 22-May-2019 | 1.2 KiB | 55 | 28 |
| install_gae.sh | H A D | 22-May-2019 | 236 | 7 | 4 |
| interceptor.go | H A D | 22-May-2019 | 3.9 KiB | 78 | 20 |
| picker_wrapper.go | H A D | 22-May-2019 | 5.2 KiB | 198 | 140 |
| picker_wrapper_test.go | H A D | 22-May-2019 | 4.8 KiB | 155 | 119 |
| pickfirst.go | H A D | 22-May-2019 | 2.8 KiB | 111 | 75 |
| pickfirst_test.go | H A D | 22-May-2019 | 11.7 KiB | 353 | 280 |
| preloader.go | H A D | 22-May-2019 | 1.8 KiB | 65 | 34 |
| proxy.go | H A D | 22-May-2019 | 4 KiB | 153 | 108 |
| proxy_test.go | H A D | 22-May-2019 | 5.5 KiB | 232 | 183 |
| resolver_conn_wrapper.go | H A D | 22-May-2019 | 4.9 KiB | 166 | 114 |
| resolver_conn_wrapper_test.go | H A D | 22-May-2019 | 4.7 KiB | 117 | 84 |
| rpc_util.go | H A D | 22-May-2019 | 25.8 KiB | 864 | 535 |
| rpc_util_test.go | H A D | 22-May-2019 | 8.2 KiB | 289 | 226 |
| server.go | H A D | 22-May-2019 | 43.4 KiB | 1,525 | 1,168 |
| server_test.go | H A D | 22-May-2019 | 3.1 KiB | 133 | 95 |
| service_config.go | H A D | 22-May-2019 | 11.4 KiB | 374 | 233 |
| service_config_test.go | H A D | 22-May-2019 | 8.5 KiB | 399 | 366 |
| stream.go | H A D | 22-May-2019 | 43.8 KiB | 1,514 | 1,108 |
| trace.go | H A D | 22-May-2019 | 3 KiB | 127 | 81 |
| version.go | H A D | 22-May-2019 | 683 | 23 | 2 |
| vet.sh | H A D | 22-May-2019 | 4.5 KiB | 130 | 93 |
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://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc)
5[![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go)
6
7The Go implementation of [gRPC](https://grpc.io/): A high performance, open
8source, general RPC framework that puts mobile and HTTP/2 first. For more
9information see the [gRPC Quick Start:
10Go](https://grpc.io/docs/quickstart/go.html) guide.
11
12Installation
13------------
14
15To install this package, you need to install Go and setup your Go workspace on
16your computer. The simplest way to install the library is to run:
17
18```
19$ go get -u google.golang.org/grpc
20```
21
22With Go module support (Go 1.11+), simply `import "google.golang.org/grpc"` in
23your source code and `go [build|run|test]` will automatically download the
24necessary dependencies ([Go modules
25ref](https://github.com/golang/go/wiki/Modules)).
26
27If you are trying to access grpc-go from within China, please see the
28[FAQ](#FAQ) below.
29
30Prerequisites
31-------------
32gRPC-Go requires Go 1.9 or later.
33
34Documentation
35-------------
36- See [godoc](https://godoc.org/google.golang.org/grpc) for package and API
37 descriptions.
38- Documentation on specific topics can be found in the [Documentation
39 directory](Documentation/).
40- Examples can be found in the [examples directory](examples/).
41
42Performance
43-----------
44Performance benchmark data for grpc-go and other languages is maintained in
45[this
46dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584&widget=490377658&container=1286539696).
47
48Status
49------
50General Availability [Google Cloud Platform Launch
51Stages](https://cloud.google.com/terms/launch-stages).
52
53FAQ
54---
55
56#### I/O Timeout Errors
57
58The `golang.org` domain may be blocked from some countries. `go get` usually
59produces an error like the following when this happens:
60
61```
62$ go get -u google.golang.org/grpc
63package 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)
64```
65
66To build Go code, there are several options:
67
68- Set up a VPN and access google.golang.org through that.
69
70- Without Go module support: `git clone` the repo manually:
71
72 ```
73 git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
74 ```
75
76 You will need to do the same for all of grpc's dependencies in `golang.org`,
77 e.g. `golang.org/x/net`.
78
79- With Go module support: it is possible to use the `replace` feature of `go
80 mod` to create aliases for golang.org packages. In your project's directory:
81
82 ```
83 go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest
84 go mod tidy
85 go mod vendor
86 go build -mod=vendor
87 ```
88
89 Again, this will need to be done for all transitive dependencies hosted on
90 golang.org as well. Please refer to [this
91 issue](https://github.com/golang/go/issues/28652) in the golang repo regarding
92 this concern.
93
94#### Compiling error, undefined: grpc.SupportPackageIsVersion
95
96Please update proto package, gRPC package and rebuild the proto files:
97 - `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}`
98 - `go get -u google.golang.org/grpc`
99 - `protoc --go_out=plugins=grpc:. *.proto`
100
101#### How to turn on logging
102
103The default logger is controlled by the environment variables. Turn everything
104on by setting:
105
106```
107GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info
108```
109
110#### The RPC failed with error `"code = Unavailable desc = transport is closing"`
111
112This error means the connection the RPC is using was closed, and there are many
113possible reasons, including:
114 1. mis-configured transport credentials, connection failed on handshaking
115 1. bytes disrupted, possibly by a proxy in between
116 1. server shutdown
117
118It can be tricky to debug this because the error happens on the client side but
119the root cause of the connection being closed is on the server side. Turn on
120logging on __both client and server__, and see if there are any transport
121errors.
122