Generate gRPC-Gateway code
Run the gRPC-Gateway plugin from an EasyP v1 generator file.
For a module whose source files use gRPC-Gateway annotations, list the module and plugins in easyp.gen.yaml:
version: v1
generate:
modules: [github.com/acme/contracts]
plugins:
- name: go
out: ./gen/go
opts:
paths: source_relative
- name: go-grpc
out: ./gen/go
opts:
paths: source_relative
- name: grpc-gateway
out: ./gen/go
opts:
paths: source_relativeInstall the corresponding protoc-gen-* executables on PATH. Declare the Git module that provides google/api/annotations.proto in the consumer's protobuf.mod, then run easyp mod tidy and easyp generate. The generator obtains that import from the locked dependency roots.
The plugin name is local to generation; schema dependency versions belong in protobuf.mod, never in easyp.gen.yaml. See adding a dependency.