Skip to content

Configuration language

Philip Vieira edited this page Dec 19, 2018 · 2 revisions

The protogen configuration language is used in .protogen files to define an execution plan for code generation with protoc.

Example

source github.com/zeeraw/protogen-protos
output ./vendor/protos
language go {
    plugin grpc
}

generate services/games v1.0.1
generate services/foobar v3.0.0

Keywords

source

Source defines the repository for your protobuf files. It can be either a path on disk or a remote git repository.

source github.com/zeeraw/protogen-protos
source /usr/local/protos

output

Output defines the output directory on for your generated code on disk. It can be a relative or absolute path.

output ./vendor/protos
output /usr/local/generated-protos

language

Language defines what programming language to generate code for. If defined with a block you can define configuration specific to the language you're generating for.

language go
language go {
  plugin grpc
}

generate

Generate defines what packages should be generated. You need to specify the package path and optionally a version tag or a branch.

generate services/games v1.0.1
generate services/foobar v3.0.0
generate services/games master
generate services/games

If specifying a version tag, it will refer to the tag <service namespace>/<vesion tag> eg. generate services/games v1.0.1 refers to the tag services/games/v1.0.1.

Clone this wiki locally