Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 1.93 KB

README.md

File metadata and controls

57 lines (46 loc) · 1.93 KB

dockerfile-protoc-go

Processing .proto for golang project via docker image

Plugins

This image has protobuf package from alpine distributive and the following plugins:

Usage

For ./proto/messages.proto run command

docker run -ti --rm \
  -w $PWD \
  -v $PWD:$PWD \
  tenderpro/protoc-go -I=./proto \
    --gogofast_out=plugins=grpc:./proto/ \
    --grpc-gateway_out=logtostderr=true:./proto/ \
    --swagger_out=logtostderr=true:./assets/ \
    --grpcer_out=soap:soap \
    --wsdl_out=cmd/webserver/ \
    --nrpc_out=. \
    --doc_out=docs \
    --doc_opt=markdown,messages.md \
    messages.proto

which will generate:

  • proto/messages.pb.go - gRPC service
  • proto/messages.pb.gw.go - JSON service
  • assets/messages.swagger.json - openapi definition
  • soap/messages.grpcer.go - SOAP service
  • cmd/webserver/messages.wsdl - WSDL file for SOAP service
  • cmd/webserver/messages.wsdl.go - WSDL for SOAP service as golang variable
  • messages.nrpc.go - NATS service (TODO: this file is obsolete and needs update)
  • docs/messages.md - markdown docs for .proto, there are several formats available

Plans

The following plugins might be added in future:

Thanks