Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ Some areas we hope to improve over the old generator are:
- simpler, faster implementation, and
- better error reporting.

Installation
------------
`go get github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic`.
If you are using Go 1.11 and see error `cannot find main module`, see this [FAQ page](https://github.com/golang/go/wiki/Modules#why-does-installing-a-tool-via-go-get-fail-with-error-cannot-find-main-module).

The generator works as a `protoc` plugin, get `protoc` from [google/protobuf](https://github.com/protocolbuffers/protobuf).

Invocation
----------
`protoc --go_gapic_out [OUTPUT_DIR] --go_gapic_opt 'package/path/url;name' a.proto b.proto`

The `go_gapic_opt` flag is necessary because we need to know where to generated file will live.
The substring before the semicolon is the import path of the package, e.g. `github.com/username/awesomeness`.
The substring after the semicolon is the name of the package used in the `package` statement.
Idiomatically the name is last element of the path but it need not be.
For instance, the last element of the path might be the package's version, and the package would benefit
from a more descriptive name.

Disclaimer
----------
This generator is currently experimental. Please don't use it for anything mission-critical.
Expand Down