Skip to content

protoc in docker container with protoc-gen-go, protoc-gen-go-grpc, protoc-gen-grpc-gateway, protoc-gen-openapiv2 and .proto files

License

Notifications You must be signed in to change notification settings

soslanco/go-protoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-protoc

The protocol buffer compiler protoc with plugins: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-grpc-gateway, protoc-gen-openapiv2 and .proto files.

Usage

Generate gRPC code and swagger.json file.

docker run --rm -v $(pwd):/code -w /code soslanco/go-protoc \
  --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  

Tips

Generate API documentation.

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

About

protoc in docker container with protoc-gen-go, protoc-gen-go-grpc, protoc-gen-grpc-gateway, protoc-gen-openapiv2 and .proto files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published