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

..08-Nov-2019-

features/H08-Nov-2019-4,3262,797

helloworld/H08-Nov-2019-486332

route_guide/H08-Nov-2019-2,7432,363

README.mdH A D08-Nov-20191.3 KiB6545

examples_test.shH A D08-Nov-20194.6 KiB149108

gotutorial.mdH A D08-Nov-201920.8 KiB432336

README.md

1gRPC in 3 minutes (Go)
2======================
3
4BACKGROUND
5-------------
6For this sample, we've already generated the server and client stubs from [helloworld.proto](helloworld/helloworld/helloworld.proto).
7
8PREREQUISITES
9-------------
10
11- This requires Go 1.9 or later
12- Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH)
13
14```
15$ go help gopath
16$ # ensure the PATH contains $GOPATH/bin
17$ export PATH=$PATH:$GOPATH/bin
18```
19
20INSTALL
21-------
22
23```
24$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
25$ go get -u google.golang.org/grpc/examples/helloworld/greeter_server
26```
27
28TRY IT!
29-------
30
31- Run the server
32
33  ```
34  $ greeter_server &
35  ```
36
37- Run the client
38
39  ```
40  $ greeter_client
41  ```
42
43OPTIONAL - Rebuilding the generated code
44----------------------------------------
45
461. Install [protobuf compiler](https://github.com/google/protobuf/blob/master/README.md#protocol-compiler-installation)
47
481. Install the protoc Go plugin
49
50   ```
51   $ go get -u github.com/golang/protobuf/protoc-gen-go
52   ```
53
541. Rebuild the generated Go code
55
56   ```
57   $ go generate google.golang.org/grpc/examples/helloworld/...
58   ```
59
60   Or run `protoc` command (with the grpc plugin)
61
62   ```
63   $ protoc -I helloworld/ helloworld/helloworld.proto --go_out=plugins=grpc:helloworld
64   ```
65