protoc-gen-connect-go

command
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL