https://github.com/russellluo/protoc-go-plugins
Some useful Go's protoc plugins.
https://github.com/russellluo/protoc-go-plugins
go grpc http protoc
Last synced: 29 days ago
JSON representation
Some useful Go's protoc plugins.
- Host: GitHub
- URL: https://github.com/russellluo/protoc-go-plugins
- Owner: RussellLuo
- Created: 2017-06-21T16:05:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-06T03:13:50.000Z (over 7 years ago)
- Last Synced: 2025-03-22T14:41:33.296Z (about 1 month ago)
- Topics: go, grpc, http, protoc
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 57
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# protoc-go-plugins
Some useful Go's protoc plugins.
## Prerequisites
- gRPC
- Protocol Buffers v3
- the protoc plugin for GoSee [gRPC Go Quickstart][1] for installation instructions.
## Plugins
### protoc-gen-gohttp
Expose your gRPC services as HTTP services.
#### Installation
Install protoc-gen-gohttp:
```bash
$ 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:
```bash
$ protoc --gohttp_out=pb_pkg_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](examples) to find out how to expose a simple gRPC service as an HTTP service on the same port.
## License
[MIT][2]
[1]: http://www.grpc.io/docs/quickstart/go.html#prerequisites
[2]: http://opensource.org/licenses/MIT