Documentation ¶
Overview ¶
protoc-gen-connect-go is a plugin for the Protobuf compiler that generates Go code. To use it, build this program and make it available on your PATH as protoc-gen-connect-go.
The 'connect-go' suffix becomes part of the arguments for the Protobuf compiler. To generate the base Go types and Connect code using protoc:
protoc --go_out=gen --connect-go_out=gen path/to/file.proto
With buf, your buf.gen.yaml will look like this:
version: v1 plugins: - name: go out: gen - name: connect-go out: gen
This generates service definitions for the Protobuf types and services defined by file.proto. If file.proto defines the foov1 Protobuf package, the invocations above will write output to:
gen/path/to/file.pb.go gen/path/to/connectfoov1/file.connect.go
Click to show internal directories.
Click to hide internal directories.