Skip to content

Commit ab66509

Browse files
authored
Add support for connect-go v2 (#2775)
Adds support for the connect-go v2 plugins --------- Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
1 parent d359d86 commit ab66509

6 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# syntax=docker/dockerfile:1.26
2+
FROM --platform=$BUILDPLATFORM golang:1.27.1-trixie@sha256:9baa6b4187bbb98d240372a8a235ac0bb6b5ddd52bba1431dc2f7c0705862728 AS build
3+
4+
ARG TARGETOS TARGETARCH
5+
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
6+
7+
RUN --mount=type=cache,target=/go/pkg/mod \
8+
go install -ldflags="-s -w" -trimpath connectrpc.com/connect/v2/cmd/protoc-gen-connect-go@v2.0.0 \
9+
&& mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-connect-go /go/bin/protoc-gen-connect-go || true
10+
11+
FROM scratch
12+
COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd
13+
COPY --from=build --link /go/bin/protoc-gen-connect-go /
14+
USER nobody
15+
ENTRYPOINT [ "/protoc-gen-connect-go" ]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: v1
2+
name: buf.build/connectrpc/go
3+
plugin_version: v2.0.0
4+
source_url: https://github.com/connectrpc/connect-go
5+
integration_guide_url: https://connectrpc.com/docs/go/getting-started
6+
description: Generates client and server stubs for connectrpc.com/connect/v2. Compatible with the gRPC, gRPC-Web, and Connect RPC protocols.
7+
deps:
8+
- plugin: buf.build/protocolbuffers/go:v1.36.12
9+
output_languages:
10+
- go
11+
registry:
12+
go:
13+
min_version: "1.26"
14+
deps:
15+
- module: connectrpc.com/connect/v2
16+
version: v2.0.0
17+
opts:
18+
- paths=source_relative
19+
spdx_license_id: Apache-2.0
20+
license_url: https://github.com/connectrpc/connect-go/blob/v2.0.0/LICENSE

‎plugins/connectrpc/gosimple/source.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ source:
22
github:
33
owner: connectrpc
44
repository: connect-go
5+
# connect-go v2 generates the simple API by default, use connectrpc/go for v2
6+
max_version: 2.0.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:lnbX0OY51EFKxFR5XrteI33vHCs5FO9HjtWecqzIbUQ=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:8Ond+l+jysrMHFNlJg47NUOj4lLeW/C1HSMbms71s2Y=

0 commit comments

Comments
 (0)