Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 16-Feb-2017 | - | ||||
helloworld/ | H | 16-Feb-2017 | - | 328 | 191 | |
route_guide/ | H | 16-Feb-2017 | - | 1,080 | 766 | |
README.md | H A D | 16-Feb-2017 | 1.2 KiB | 58 | 42 | |
gotutorial.md | H A D | 16-Feb-2017 | 20.8 KiB | 432 | 336 |
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.4 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 First [install protoc](https://github.com/google/protobuf/blob/master/README.md) 47 - For now, this needs to be installed from source 48 - This is will change once proto3 is officially released 49 502 Install the protoc Go plugin. 51 52``` 53$ go get -a github.com/golang/protobuf/protoc-gen-go 54$ 55$ # from this dir; invoke protoc 56$ protoc -I ./helloworld/helloworld/ ./helloworld/helloworld/helloworld.proto --go_out=plugins=grpc:helloworld 57``` 58