github.com/stackdocker/rkt@v0.10.1-0.20151109095037-1aa827478248/Godeps/_workspace/src/google.golang.org/grpc/examples/README.md (about)

     1  gRPC in 3 minutes (Go)
     2  ======================
     3  
     4  BACKGROUND
     5  -------------
     6  For this sample, we've already generated the server and client stubs from [helloworld.proto](examples/helloworld/proto/helloworld.proto). 
     7  
     8  PREREQUISITES
     9  -------------
    10  
    11  - This requires Go 1.4
    12  - Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH)
    13  ```sh
    14  $ go help gopath
    15  $ # ensure the PATH contains $GOPATH/bin
    16  $ export PATH=$PATH:$GOPATH/bin
    17  ```
    18  
    19  INSTALL
    20  -------
    21  
    22  ```sh
    23  $ go get -u github.com/grpc/grpc-go/examples/greeter_client
    24  $ go get -u github.com/grpc/grpc-go/examples/greeter_server
    25  ```
    26  
    27  TRY IT!
    28  -------
    29  
    30  - Run the server
    31  ```sh
    32  $ greeter_server &
    33  ```
    34  
    35  - Run the client
    36  ```sh
    37  $ greeter_client
    38  ```
    39  
    40  OPTIONAL - Rebuilding the generated code
    41  ----------------------------------------
    42  
    43  1 First [install protoc](https://github.com/google/protobuf/blob/master/INSTALL.txt)
    44    - For now, this needs to be installed from source
    45    - This is will change once proto3 is officially released
    46  
    47  2 Install the protoc Go plugin.
    48  ```sh
    49  $ go get -a github.com/golang/protobuf/protoc-gen-go
    50  $
    51  $ # from this dir; invoke protoc
    52  $ protoc -I ./helloworld/proto/ ./helloworld/proto/helloworld.proto --go_out=plugins=grpc:helloworld
    53  ```