From 2a4fa3b0cc26aa27fdf48c9137b9857340081057 Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Wed, 27 Nov 2024 13:31:06 -0500 Subject: [PATCH] Add plugin Resources client --- go.sum | 4 ---- .../bufregistryapiplugin.go | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/go.sum b/go.sum index 01f8c0d556..2cdf4394c4 100644 --- a/go.sum +++ b/go.sum @@ -2,12 +2,8 @@ buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.35.2-20241031151143-70 buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.35.2-20241031151143-70f632351282.1/go.mod h1:vKDy7lD1bsN2UjeLhqklPEjIsHfHAPgMb/PbRx2EFDc= buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.35.2-20240920164238-5a7b106cbb87.1 h1:7QIeAuTdLp173vC/9JojRMDFcpmqtoYrxPmvdHAOynw= buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.35.2-20240920164238-5a7b106cbb87.1/go.mod h1:mnHCFccv4HwuIAOHNGdiIc5ZYbBCvbTWZcodLN5wITI= -buf.build/gen/go/bufbuild/registry/connectrpc/go v1.17.0-20241025140216-aa40f2c93090.1 h1:FHQXg3T7S2jp8yc7/bQJgqEH1yza/rrDHXITUK2Tm0g= -buf.build/gen/go/bufbuild/registry/connectrpc/go v1.17.0-20241025140216-aa40f2c93090.1/go.mod h1:5iwF5l+9lKCnvr1zLvDgUHrv6X+vU5nNPjvig1sbnao= buf.build/gen/go/bufbuild/registry/connectrpc/go v1.17.0-20241125212318-4a305dc3b757.1 h1:q3PKZJfOuSZR8KC0asyo7EFID/3613pDFzFYAAO+Gd4= buf.build/gen/go/bufbuild/registry/connectrpc/go v1.17.0-20241125212318-4a305dc3b757.1/go.mod h1:w+XYJEgdkHK5XJ+44Eq2YD02DZVLFNFjfwFKPz0nZcg= -buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.35.2-20241025140216-aa40f2c93090.1 h1:a1OY15kRBrD1AF0SYIPYFLE8GCC1d85zqENnzUC3lNM= -buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.35.2-20241025140216-aa40f2c93090.1/go.mod h1:EQCcR04Wp6ffVPfxNb4ZXAVJXrZJopDNKQWp37BDCgU= buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.35.2-20241125212318-4a305dc3b757.1 h1:m2QVURqXvfedovCeWV5CsWm3VIrD87RHL+9P9o7HB84= buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.35.2-20241125212318-4a305dc3b757.1/go.mod h1:EQCcR04Wp6ffVPfxNb4ZXAVJXrZJopDNKQWp37BDCgU= buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.35.2-20241007202033-cf42259fcbfc.1 h1:FcoYwX9eJhc73MdVlqyJjMOQ863akpHK0VEQ/+Zkt9U= diff --git a/private/bufpkg/bufregistryapi/bufregistryapiplugin/bufregistryapiplugin.go b/private/bufpkg/bufregistryapi/bufregistryapiplugin/bufregistryapiplugin.go index 1cba7fb1f2..d9dc3314ee 100644 --- a/private/bufpkg/bufregistryapi/bufregistryapiplugin/bufregistryapiplugin.go +++ b/private/bufpkg/bufregistryapi/bufregistryapiplugin/bufregistryapiplugin.go @@ -30,6 +30,8 @@ var ( NopV1Beta1LabelServiceClientProvider V1Beta1LabelServiceClientProvider = nopClientProvider{} // NopV1Beta1PluginServiceClientProvider is a V1Beta1PluginServiceClientProvider that provides unimplemented services for testing. NopV1Beta1PluginServiceClientProvider V1Beta1PluginServiceClientProvider = nopClientProvider{} + // NopV1Beta1ResourceServiceClientProvider is a V1Beta1ResourceServiceClientProvider that provides unimplemented services for testing. + NopV1Beta1ResourceServiceClientProvider V1Beta1ResourceServiceClientProvider = nopClientProvider{} // NopV1Beta1UploadServiceClientProvider is a V1Beta1UploadServiceClientProvider that provides unimplemented services for testing. NopV1Beta1UploadServiceClientProvider V1Beta1UploadServiceClientProvider = nopClientProvider{} // NopClientProvider is a ClientProvider that provides unimplemented services for testing. @@ -56,6 +58,11 @@ type V1Beta1LabelServiceClientProvider interface { V1Beta1LabelServiceClient(registry string) pluginv1beta1connect.LabelServiceClient } +// V1Beta1ResourceServiceClientProvider provides ResourceServiceClients. +type V1Beta1ResourceServiceClientProvider interface { + V1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient +} + // V1Beta1PluginServiceClientProvider provides PluginServiceClients. type V1Beta1PluginServiceClientProvider interface { V1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient @@ -72,6 +79,7 @@ type ClientProvider interface { V1Beta1CommitServiceClientProvider V1Beta1DownloadServiceClientProvider V1Beta1LabelServiceClientProvider + V1Beta1ResourceServiceClientProvider V1Beta1PluginServiceClientProvider V1Beta1UploadServiceClientProvider } @@ -125,6 +133,14 @@ func (c *clientProvider) V1Beta1LabelServiceClient(registry string) pluginv1beta ) } +func (c *clientProvider) V1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient { + return connectclient.Make( + c.clientConfig, + registry, + pluginv1beta1connect.NewResourceServiceClient, + ) +} + func (c *clientProvider) V1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient { return connectclient.Make( c.clientConfig, @@ -159,6 +175,10 @@ func (nopClientProvider) V1Beta1LabelServiceClient(registry string) pluginv1beta return pluginv1beta1connect.UnimplementedLabelServiceHandler{} } +func (nopClientProvider) V1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient { + return pluginv1beta1connect.UnimplementedResourceServiceHandler{} +} + func (nopClientProvider) V1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient { return pluginv1beta1connect.UnimplementedPluginServiceHandler{} }