Protoc Go Plugins Save

Some useful Go's protoc plugins.

Project README

protoc-go-plugins

Some useful Go's protoc plugins.

Prerequisites

  • gRPC
  • Protocol Buffers v3
  • the protoc plugin for Go

See gRPC Go Quickstart for installation instructions.

Plugins

protoc-gen-gohttp

Expose your gRPC services as HTTP services.

Installation

Install protoc-gen-gohttp:

$ go get -u github.com/RussellLuo/protoc-go-plugins/protoc-gen-gohttp

Usage

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.

Examples

See examples to find out how to expose a simple gRPC service as an HTTP service on the same port.

License

MIT

Open Source Agenda is not affiliated with "Protoc Go Plugins" Project. README Source: RussellLuo/protoc-go-plugins
Stars
57
Open Issues
0
Last Commit
6 years ago

Open Source Agenda Badge

Open Source Agenda Rating