Skip to content

TenderPro/dockerfile-protoc-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Processing .proto for golang project via docker image

Resources

License

Stars

Watchers

Forks

Packages

No packages published