Sign inSign up

soslanco/go-protoc

By soslanco

•Updated 22 days ago

The protoc compiler with .proto files and plugins.

Image
Languages & frameworks
API management
Developer tools
0

1.5K

soslanco/go-protoc repository overview

⁠go-protoc

The protocol buffer compiler protoc with .proto files and plugins:

  • protoc-gen-go
  • protoc-gen-go-grpc
  • protoc-gen-grpc-gateway
  • protoc-gen-openapiv2
  • protoc-go-inject-tag
⁠Usage
⁠Generate gRPC code and swagger.json file.
docker run --rm -v $(pwd):/code -w /code soslanco/go-protoc:latest \
  --go_out . --go_opt paths=source_relative \
  --go-grpc_out . --go-grpc_opt paths=source_relative \
  --grpc-gateway_out . \
  --grpc-gateway_opt logtostderr=true \
  --grpc-gateway_opt paths=source_relative \
  --openapiv2_out . \
  --openapiv2_opt logtostderr=true \
  helloworld.proto

output:

helloworld.pb.go       
helloworld.pb.gw.go    
helloworld.swagger.json
helloworld_grpc.pb.go  
⁠Inject custom tags
docker run --rm -v $(pwd):/code -w /code --entrypoint protoc-go-inject-tag soslanco/go-protoc:latest -input="*.pb.go"
⁠Tips

Generate API documentation.

docker run --rm -v $(pwd):/data ghcr.io/redocly/redoc/cli build helloworld.swagger.json -o helloworld.html

Tag summary

Content type

Image

Digest

sha256:086fd8d7f…

Size

38 MB

Last updated

22 days ago

docker pull soslanco/go-protoc