protoc-gen-alias
protoc-gen-alias
is a plugin for protoc which type alias for all messages, such that one protobuf definition can
be consumed from many Go packages
Usage
Usage is typically through buf
, but you can use directly.
See test/Makefile
for example usage.
Configuration
The plugin looks for a comment like +cue-gen:Simple:versions:v1,v1alpha
on the package.
This will generate aliases to the current version, for all versions listed (the current version is ignored).
Examples Of Generated Code
// Code generated by protoc-gen-jsonshim. DO NOT EDIT.
type Simple = v1.Simple
type Simple_Name = v1.Simple_Name
type Simple_Number = v1.Simple_Number
type SimpleWithMap = v1.SimpleWithMap
type SimpleWithMap_Nested = v1.SimpleWithMap_Nested
type ReferencedMap = v1.ReferencedMap
type ImportedReference = v1.ImportedReference