/atlas-gentool

Docker image to generate the Go source code from Protocol Buffer schemes

Primary LanguageDockerfileApache License 2.0Apache-2.0

Docker image to generate Go source code from Protocol Buffer schemes

This repository provides the Docker image used to generate the Go source code from Protocol Buffer schemes.

Build

Build of the Docker image requires docker engine and make utility as pre-requisites. As the requirements are satisfied, use the following command to compile the latest version of the Docker image:

make latest

Usage

To generate the Go source code using the provided tool, you could start with the following command, where

  • project variable defines the Go project
  • plugin variable defines protoc plugin (go, grpc-gateway, validate, swagger, etc.)
  • plugin_args variable defines arguments to be passed to the specified plugin
  • {schema} variable defines your Protocol Buffer schema

NOTE It is supposed that your proto schema has proper option go_package set. E.g: option go_package = "github.com/{your_repo}/{your_app}"

docker run --rm -v $(pwd):/go/src/${project} \
    infoblox/atlas-gentool:latest --{plugin}_out={plugin_args} ${project}/{schema}.proto

Plugins

  • protoc-gen-go
  • protoc-gen-combo
  • protoc-gen-gofast
  • protoc-gen-gogo
  • protoc-gen-gogofast
  • protoc-gen-gogofaster
  • protoc-gen-gogoslick
  • protoc-gen-gogotypes
  • protoc-gen-gostring
  • protoc-gen-swagger
  • protoc-gen-grpc-gateway
  • protoc-gen-validate
  • protoc-gen-govalidators
  • protoc-gen-doc
  • protoc-gen-gorm (Infoblox Open)