Proto commits in connectrpc/connect-go

These 40 commits are when the Protocol Buffers files have changed:

Commit:2b9d2f6
Author:Edward McFarlane
Committer:GitHub

Upgrade LICENSE years 2025 (#836) <!-- Before submitting your PR, please read through the contribution guide! https://github.com/connectrpc/connect-go/blob/main/.github/CONTRIBUTING.md --> Signed-off-by: Edward McFarlane <emcfarlane@buf.build>

The documentation is generated from this commit.

Commit:044befe
Author:Edward McFarlane
Committer:GitHub

Fix protoc-gen-go schema variable case handling (#808) <!-- Before submitting your PR, please read through the contribution guide! https://github.com/connectrpc/connect-go/blob/main/.github/CONTRIBUTING.md --> This fixes the handling of various casing when generating the service methods variable. Fixes https://github.com/connectrpc/connect-go/issues/807 Signed-off-by: Edward McFarlane <emcfarlane@buf.build>

Commit:29d45c4
Author:bufdev
Committer:GitHub

Add same_package option to protoc-gen-connect-go (#803) This adds an option `package_suffix` to `protoc-gen-connect-go`. It allows to customize the output directory for the generated code. The sub-package of the package containing the base .pb.go files using the given suffix. An empty suffix denotes to generate into the same package as the base pb.go files. Default is "connect". --------- Signed-off-by: bufdev <bufdev-github@buf.build> Signed-off-by: Edward McFarlane <emcfarlane@buf.build> Co-authored-by: Edward McFarlane <emcfarlane@buf.build>

Commit:9e6bef9
Author:Edward McFarlane
Committer:GitHub

Update copyright for 2024 (#667)

Commit:bbcaf0b
Author:Akshay Shah
Committer:GitHub

Update copyright (#590) Update to use "The Connect Authors" instead of "Buf Technologies, Inc."

Commit:019774d
Author:jchadwick-buf
Committer:GitHub

Connect HTTP Get support (#478) Co-authored-by: Akshay Shah <akshay@akshayshah.org>

Commit:d13c1a3
Author:Akshay Shah
Committer:GitHub

Improve comments & add procedure consts to generated code (#480)

Commit:b5b7da8
Author:Joshua Carpeggiani
Committer:GitHub

Update copyright year to 2023 (#434) Updates copyright year to 2023

Commit:0a716a0
Author:Joshua Carpeggiani
Committer:GitHub

Import base go file even if there are no base types required (#418) If a service solely requires types from other packages the result is that the connect services don't have access to the filedescriptorsets. This causes a lot of issues such as server reflection failing. This PR blank imports the base go file that should always exist For the proto file: ```proto // service/eliza.proto syntax = "proto3"; package service; import "models/eliza.proto"; service ElizaService { } // models/eliza.proto syntax = "proto3"; package ext; message SayRequest { string sentence = 1; } message SayResponse { string sentence = 1; } ``` The following diff occurs in the generated `eliza.connect.go` code ```diff package serviceconnect import ( context "context" errors "errors" models "github.com/bufbuild/connect-demo/internal/gen/buf/connect/demo/eliza/v1/models" + _ "github.com/bufbuild/connect-demo/internal/gen/buf/connect/demo/eliza/v1/service" connect_go "github.com/bufbuild/connect-go" http "net/http" strings "strings" ) ``` There is no change if the base types are already in the `service/eliza.proto` (the way we recommend using proto files) Closes TCN-786

Commit:a0d0478
Author:Akshay Shah
Committer:GitHub

Handle Go keywords in Protobuf definitions (#348)

Commit:1773257
Author:Akshay Shah
Committer:GitHub

Send binary data with error details (#329)

Commit:4249483
Author:Akshay Shah
Committer:Akshay Shah

Add Error protobuf message for Connect protocol

Commit:335da5a
Author:bufdev
Committer:GitHub

Add buf format and make lintfix a dependency of generate (#167)

Commit:6ca0ffb
Author:Luc Perkins
Committer:Akshay Shah

Correct Protocol Buffers and Connect capitalization

Commit:2b42e3a
Author:Akshay Shah
Committer:GitHub

More-explicit alternative to Registrar (#148) Rather than using the Registrar type to implicitly track the users' protobuf services, this PR proposes a more-explicit alternative. For the user-visible change, see the diff to handler_example_test.go. This is an alternative to #146. We'll move health and reflection into their own modules.

Commit:a7328b0
Author:Akshay Shah
Committer:Akshay Shah

Promote ping from v1test to v1 We're using the ping service all over examples, and the generated code is more realistic with a non-test protobuf package name.

Commit:ec149bc
Author:Akshay Shah
Committer:GitHub

Leverage managed mode more (#136) We don't need `go_package` options in the protobuf files anymore, since we're using Buf's managed mode.

Commit:7c93e83
Author:Akshay Shah
Committer:GitHub

Restructure proto dirs to avert file collisions (#134) The package-global protobuf registry in Go checks that each file name is only registered once. Since file names are relative to the protoc include path or the Buf workspace, our vendored version of the gRPC health.proto is `grpc/health/v1/health.proto`. Sadly, that's the same relative path as grpc-go's copy, so having both connect and grpc-go in your import graph causes an init-time panic. This PR fixes the problem by putting all the vendored code into an `connectext` subdirectory.

Commit:a75807b
Author:Akshay Shah
Committer:Akshay Shah

Add licenses

Commit:822d075
Author:Akshay Shah
Committer:Akshay Shah

Remove crosstest We're separating crosstest into `github.com/bufbuild/connect-crosstest`, so we don't need to complicate the main build. This commit massively bloats our `go.mod`, but we'll slim it down again later in the patch series.

Commit:d74d60b
Author:Akshay Shah
Committer:Akshay Shah

Move proto to internal/proto

Commit:e7157fb
Author:bufdev
Committer:Akshay Shah

s/bufconnect/bufbuild/g (#82) Rename to reflect new repository.

Commit:b047f0c
Author:Akshay Shah
Committer:Akshay Shah

Update to match style guide (#74) Extensive but low-substance edits to match Buf's style guide.

Commit:2eb6ffa
Author:Doria Keung
Committer:Akshay Shah

Clean-up leading comments propagation in plugin generation (#66) Handle comments in the protobuf IDL correctly and propagate service & method deprecation. Fixes #28.

Commit:7d9fc62
Author:Akshay Shah
Committer:Akshay Shah

Rename project to bufconnect/connect Rename everything to use the `bufconnect/connect` name, including restructuring the protobuf directories. At the end of this change, a recursive, case-insensitive search for "rerpc" turns up no matches.

Commit:fa11ba1
Author:Akshay Shah
Committer:Akshay Shah

Hide generics by default Generic request and response types make more-complex use cases much nicer, but they make simple clients and handlers feel cumbersome. This commit changes the generated code to hide the generic types by default. We generate clients that use the protobuf message types directly by default. (So they'd use *PingRequest rather than *rerpc.Request[PingRequest].) To get access to the full API, users call the Full() method on the client. Servers are a bit more complex, because users are implementing an interface. We'd like users to start with the simpler signatures, switching to the more complex generic signatures as necessary. When switching, though, they should be able to switch just one method - they shouldn't have to switch all their methods to implement a new interface. To accomplish this, we generate two entry points: one is very strongly typed and takes an implementation of the full generic interface, and one is more loosely typed and lets users mix and match between the two interfaces. To make all this work without awful names, we lay claim to names like NewPingServiceClient. To avoid conflicts with gRPC, Twirp, etc., we expose an option to let users generate code into a separate package.

Commit:8099646
Author:Akshay Shah
Committer:Akshay Shah

Add cross-compat tests for streaming Add tests to exercise compatibility with grpc-go's streaming support.

Commit:5ee9ed5
Author:Akshay Shah
Committer:Akshay Shah

Use generated code for reflection handler Rather than hand-rolling bidirectional streaming, generate code for the server reflection API.

Commit:34b2fcb
Author:Akshay Shah
Committer:Akshay Shah

Generate health client and handler in separate pkg

Commit:b6b5c6f
Author:Akshay Shah
Committer:Akshay Shah

Generate server-side streaming code Generate server-side code for server, client, and bidi streaming. This commit doesn't include any tests (!!) - I'll add them once the client-side code is also ready.

Commit:27d689a
Author:Sever Banesiu
Committer:Akshay Shah

Add variable length field to ping Add a string Msg field to ping to ease testing for maximum body size.

Commit:9bbe5e5
Author:Akshay Shah
Committer:Akshay Shah

Move to rerpc organization Rewrite import paths to github.com/rerpc/rerpc instead of my personal account. I think this project might have some legs, and there are a few plugins and satellite packages I'd like to keep in a shared namespace.

Commit:0ec8298
Author:Akshay Shah
Committer:Akshay Shah

Build protobuf with buf It's annoying to get a recent protoc on LTS versions of Ubuntu, so I thought I'd support my friends over at Buf and try out their tool. Turns out that I had a lot of protobuf that didn't meet Peter's bar :) This commit fixes all the lint errors, fixes the resulting build errors, and moves the Makefile to use a locally-installed buf. This diff is unmanageably enormous, but this is a personal project free of the tyranny of code review. Overall, buf is pretty nice. I can't find a way to skip gRPC and Twirp codegen in the main module, so I'm just deleting the unwanted files. I chimed in on https://github.com/bufbuild/buf/issues/224 to see if they're willing to add an allowlist.

Commit:7bca122
Author:Akshay Shah
Committer:Akshay Shah

Fix protobuf field number Mistakenly skipped field 1 in a protobuf message.

Commit:ea0baa8
Author:Akshay Shah
Committer:Akshay Shah

Add tests for gRPC client cancellation and timeout Exercise the gRPC client's support for cancellation and timeout in the integration tests.

Commit:24c20b0
Author:Akshay Shah
Committer:Akshay Shah

Add support for gRPC's health API Add support for the unary portion of gRPC's health-checking API. We could support watching health using the rawGRPC backdoor in Handler (as we do for server reflection), but per-service change detection seems like more effort than it's worth. Very few deployments have enough health checking traffic to make the extra efficiency meaningful.

Commit:2571b32
Author:Akshay Shah
Committer:Akshay Shah

Add hand-rolled reflection support Implement gRPC's server reflection API and make some small API changes to permit registration in handler constructors. This is an especially hairy change because the server reflection API uses bidi streaming. I'm reluctant to expose streaming to users, so this commit introduces a backdoor that lets internal handlers write and read raw bytes. On the plus side, the new protobuf package makes implementing the actual logic *much* easier - reRPC's reflection handler ends up much simpler than grpc-go's.

Commit:f0b8862
Author:Akshay Shah
Committer:Akshay Shah

Add protoc-gen-go-rerpc and an example service Add code generation to wire up Handler and Invoke, then generate code for a sample service. We'll use the sample service in our integration tests.

Commit:9d61075
Author:Akshay Shah
Committer:Akshay Shah

Add cross-testing with grpc-go Add tests to the internal/crosstest package validating that we're compatible with grpc-go. The tests validate that both the reRPC and gRPC clients work with: * A reRPC server speaking HTTP/2 with TLS. * A reRPC server speaking HTTP/2 with h2c. * A gRPC server speaking HTTP/2 with TLS.

Commit:6df7d88
Author:Akshay Shah
Committer:Akshay Shah

Add internal package for status protobuf To write the grpc-status-details-bin header, we need to produce protobuf bytes compatible with gRPC's status.Status protobuf message. Unfortunately, copying in gRPC's protobuf package as-is will likely generate errors, since each fully-qualified package can be registed only once. To work around this, this commit copies in the protobuf IDL, changes the package name, and keeps the generated types entirely private.