Some useful Go's protoc plugins.
- gRPC
- Protocol Buffers v3
- the protoc plugin for Go
See gRPC Go Quickstart for installation instructions.
Expose your gRPC services as HTTP services.
Install protoc-gen-gohttp:
$ go get -u github.com/RussellLuo/protoc-go-plugins/protoc-gen-gohttp
Generate HTTP services for all gRPC services defined in the proto file:
$ protoc <proto file> --gohttp_out=pb_pkg_path=<pb pacakge path>:<output path>
As you can see, pb_pkg_path
is the path of the pb package, which is generated by protoc-gen-go
.
See examples to find out how to expose a simple gRPC service as an HTTP service on the same port.