Skip to content

RussellLuo/protoc-go-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Some useful Go's protoc plugins.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages