Package list golang-github-go-kit-kit / b74e303
update grpc readme information about protoc and streams David Sudia 4 years ago
1 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
11
22 [gRPC](http://www.grpc.io/) is an excellent, modern IDL and transport for microservices.
33 If you're starting a greenfield project, Go kit strongly recommends gRPC as your default transport.
4 And using gRPC and Go kit together is very simple.
4
5 One important note is that while gRPC supports streaming requests and replies, go-kit does not. You can still use streams in your service, but their implementation will not be able to take advantage of many go-kit features like middleware.
6
7 Using gRPC and Go kit together is very simple.
58
69 First, define your service using protobuf3.
710 This is explained [in gRPC documentation](http://www.grpc.io/docs/#defining-a-service).
912 Make sure the proto definition matches your service's Go kit (interface) definition.
1013
1114 Next, get the protoc compiler.
12 Unfortunately, this needs to be done from source.
13 Fortunately, it's pretty straightforward.
1415
15 ```
16 You can download pre-compiled binaries from the [protobuf release page](https://github.com/google/protobuf/releases). You will unzip a folder called `protoc3` with a subdirectory `bin` containing an executable. Move that executable somewhere in your `$PATH` and you're good to go!
17
18 It can also be built from source.
19
20 ```sh
1621 brew install autoconf automake libtool
1722 git clone https://github.com/google/protobuf
1823 cd protobuf
2126
2227 Then, compile your service definition, from .proto to .go.
2328
24 ```
29 ```sh
2530 protoc add.proto --go_out=plugins=grpc:.
2631 ```
2732