Skip to content

A docker container to compile protobufs with protoc-gen-grpc-gateway

License

Notifications You must be signed in to change notification settings

diebietse/go-gw-protoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-gw-protoc

A docker container to compile Protocol Buffers with protoc-gen-grpc-gateway

release publish-docker-image license

The Docker image is available on [Docker Hub][docker-hub]

It is based on golang:1.13-buster and adds all the packages needed for using protoc to compile your Protocol Buffers for gRPC and grpc-gateway

You can generate the gRPC and gRPC-gateway go source with:

docker run --rm -v ${PWD}:/source diebietse/go-gw-protoc -I. --go_out=plugins=grpc:. --grpc-gateway_out=logtostderr=true:. hello-world.proto

To test it go to the example folder, run build.sh and it will create hello-world.pb.go and hello-world.pb.gw.go

To use gogofaster for source code generation use

docker run --rm -v ${PWD}:/source diebietse/go-gw-protoc -I. --gogofaster_out=plugins=grpc:. --grpc-gateway_out=logtostderr=true:. hello-world.proto

Gogofaster can also be used to generate marshallers and unmarshallers as well as a host of other options. For an example of that run

docker run --rm -v ${PWD}:/source diebietse/go-gw-protoc -I. --gogofaster_out=plugins=grpc:. --grpc-gateway_out=logtostderr=true:. hello-worldgogo.proto
docker run --rm -v ${PWD}:/source diebietse/go-gw-protoc:latest \
-I./ \
-I/usr/local/include \
--go_out=paths=source_relative,plugins=grpc:./ \
--validate_out="lang=go:./" \
hello-world-validate.proto

See https://github.com/gogo/protobuf for more information.

About

A docker container to compile protobufs with protoc-gen-grpc-gateway

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •