transport/*/README.md: minor copyediting
Peter Bourgon
8 years ago
5 | 5 |
|
6 | 6 |
First, define your service using protobuf3.
|
7 | 7 |
This is explained [in gRPC documentation](http://www.grpc.io/docs/#defining-a-service).
|
8 | |
[See add.proto](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/pb/add.proto) for an example.
|
|
8 |
See [add.proto](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/pb/add.proto) for an example.
|
9 | 9 |
Make sure the proto definition matches your service's Go kit (interface) definition.
|
10 | 10 |
|
11 | 11 |
Next, get the protoc compiler.
|
|
27 | 27 |
|
28 | 28 |
Finally, write a tiny binding from your service definition to the gRPC definition.
|
29 | 29 |
It's a simple conversion from one domain to another.
|
30 | |
[See grpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/grpc_binding.go) for an example.
|
|
30 |
See [grpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/grpc_binding.go) for an example.
|
31 | 31 |
|
32 | 32 |
That's it!
|
33 | 33 |
The gRPC binding can be bound to a listener and serve normal gRPC requests.
|
4 | 4 |
|
5 | 5 |
Using net/rpc with Go kit is very simple.
|
6 | 6 |
Just write a simple binding from your service definition to the net/rpc definition.
|
7 | |
[See netrpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/netrpc_binding.go) for an example.
|
|
7 |
See [netrpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/netrpc_binding.go) for an example.
|
8 | 8 |
|
9 | 9 |
That's it!
|
10 | 10 |
The net/rpc binding can be registered to a name, and bound to an HTTP handler, the same as any other net/rpc endpoint.
|
0 | 0 |
# Thrift
|
1 | 1 |
|
2 | |
[Thrift](https://thrift.apache.org/) is a popular IDL and transport package from Apache, popularized by Facebook.
|
|
2 |
[Thrift](https://thrift.apache.org/) is a large IDL and transport package from Apache, popularized by Facebook.
|
3 | 3 |
Thrift is well-supported in Go kit, for organizations that already have significant Thrift investment.
|
4 | 4 |
And using Thrift with Go kit is very simple.
|
5 | 5 |
|