Path: blob/main/components/public-api/go/experimental/v1/v1connect/scm.connect.go
2501 views
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-connect-go. DO NOT EDIT.5//6// Source: gitpod/experimental/v1/scm.proto78package v1connect910import (11context "context"12errors "errors"13connect_go "github.com/bufbuild/connect-go"14v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1"15http "net/http"16strings "strings"17)1819// This is a compile-time assertion to ensure that this generated file and the connect package are20// compatible. If you get a compiler error that this constant is not defined, this code was21// generated with a version of connect newer than the one compiled into your binary. You can fix the22// problem by either regenerating this code with an older version of connect or updating the connect23// version compiled into your binary.24const _ = connect_go.IsAtLeastVersion0_1_02526const (27// SCMServiceName is the fully-qualified name of the SCMService service.28SCMServiceName = "gitpod.experimental.v1.SCMService"29)3031// SCMServiceClient is a client for the gitpod.experimental.v1.SCMService service.32type SCMServiceClient interface {33// GetSuggestedRepoURLs returns a list of suggested repositories to open for34// the user.35GetSuggestedRepoURLs(context.Context, *connect_go.Request[v1.GetSuggestedRepoURLsRequest]) (*connect_go.Response[v1.GetSuggestedRepoURLsResponse], error)36}3738// NewSCMServiceClient constructs a client for the gitpod.experimental.v1.SCMService service. By39// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,40// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the41// connect.WithGRPC() or connect.WithGRPCWeb() options.42//43// The URL supplied here should be the base URL for the Connect or gRPC server (for example,44// http://api.acme.com or https://acme.com/grpc).45func NewSCMServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) SCMServiceClient {46baseURL = strings.TrimRight(baseURL, "/")47return &sCMServiceClient{48getSuggestedRepoURLs: connect_go.NewClient[v1.GetSuggestedRepoURLsRequest, v1.GetSuggestedRepoURLsResponse](49httpClient,50baseURL+"/gitpod.experimental.v1.SCMService/GetSuggestedRepoURLs",51opts...,52),53}54}5556// sCMServiceClient implements SCMServiceClient.57type sCMServiceClient struct {58getSuggestedRepoURLs *connect_go.Client[v1.GetSuggestedRepoURLsRequest, v1.GetSuggestedRepoURLsResponse]59}6061// GetSuggestedRepoURLs calls gitpod.experimental.v1.SCMService.GetSuggestedRepoURLs.62func (c *sCMServiceClient) GetSuggestedRepoURLs(ctx context.Context, req *connect_go.Request[v1.GetSuggestedRepoURLsRequest]) (*connect_go.Response[v1.GetSuggestedRepoURLsResponse], error) {63return c.getSuggestedRepoURLs.CallUnary(ctx, req)64}6566// SCMServiceHandler is an implementation of the gitpod.experimental.v1.SCMService service.67type SCMServiceHandler interface {68// GetSuggestedRepoURLs returns a list of suggested repositories to open for69// the user.70GetSuggestedRepoURLs(context.Context, *connect_go.Request[v1.GetSuggestedRepoURLsRequest]) (*connect_go.Response[v1.GetSuggestedRepoURLsResponse], error)71}7273// NewSCMServiceHandler builds an HTTP handler from the service implementation. It returns the path74// on which to mount the handler and the handler itself.75//76// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf77// and JSON codecs. They also support gzip compression.78func NewSCMServiceHandler(svc SCMServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {79mux := http.NewServeMux()80mux.Handle("/gitpod.experimental.v1.SCMService/GetSuggestedRepoURLs", connect_go.NewUnaryHandler(81"/gitpod.experimental.v1.SCMService/GetSuggestedRepoURLs",82svc.GetSuggestedRepoURLs,83opts...,84))85return "/gitpod.experimental.v1.SCMService/", mux86}8788// UnimplementedSCMServiceHandler returns CodeUnimplemented from all methods.89type UnimplementedSCMServiceHandler struct{}9091func (UnimplementedSCMServiceHandler) GetSuggestedRepoURLs(context.Context, *connect_go.Request[v1.GetSuggestedRepoURLsRequest]) (*connect_go.Response[v1.GetSuggestedRepoURLsResponse], error) {92return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.SCMService.GetSuggestedRepoURLs is not implemented"))93}949596