aboutsummaryrefslogtreecommitdiffhomepage
path: root/go/README.md
diff options
context:
space:
mode:
authorGravatar Tim Emiola <temiola@google.com>2015-02-20 03:47:37 -0800
committerGravatar Tim Emiola <temiola@google.com>2015-02-20 07:51:02 -0800
commit81580a97bbe5411e8576409a2b681a34a070a165 (patch)
treefd971190d09a5e4f1ce93d25260413fc14fd63c0 /go/README.md
parent4eb1a89218831c2904b03d225b461657dece205a (diff)
Adds a helloworld sample in Go.
Diffstat (limited to 'go/README.md')
-rw-r--r--go/README.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/go/README.md b/go/README.md
new file mode 100644
index 0000000000..df81915c9b
--- /dev/null
+++ b/go/README.md
@@ -0,0 +1,51 @@
+gRPC Go Hello World
+===================
+
+PREREQUISITES
+-------------
+
+- This requires Go 1.4.x
+- Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH)
+```sh
+$ go help gopath
+$ # ensure the PATH contains $GOPATH/bin or $GOBIN
+$ export PATH=PATH:<your/gopath/bin>
+```
+
+INSTALL
+-------
+
+```sh
+$ export GOPATH=<path/to/your/go/workspace>
+$ go install -u github.com/grpc-common/go/greeter_client
+$ go install -u github.com/grpc-common/go/greeter_server
+```
+
+OPTIONAL - Rebuild the generated code
+-------------------------------------
+
+1 First [install protoc](https://github.com/google/protobuf/blob/master/INSTALL.txt)
+ - For now, this needs to be installed from source
+ - This is will change once proto3 is officially released
+2 Install the protoc Go plugin.
+```sh
+$ go install -a github.com/golang/protobuf/protoc-gen-go
+$ # ensure the PATH contains $GOPATH/bin or $GOBIN
+$ export PATH=PATH:<your/gopath/bin>
+$
+$ # from ths dir; invoke protoc
+$ protoc -I ../protos ../protos/helloworld.proto --go_out=plugins=grpc:.
+```
+
+TRY IT!
+-------
+
+- Run the server
+```sh
+$ greeter_server &
+```
+
+- Run the client
+```sh
+$ greeter_client
+```