Path: blob/main/components/public-api/go/experimental/v1/v1connect/ide_client.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/ide_client.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// IDEClientServiceName is the fully-qualified name of the IDEClientService service.28IDEClientServiceName = "gitpod.experimental.v1.IDEClientService"29)3031// IDEClientServiceClient is a client for the gitpod.experimental.v1.IDEClientService service.32type IDEClientServiceClient interface {33// SendHeartbeat sends a clientheartbeat signal for a running workspace.34SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error)35// SendDidClose sends a client close signal for a running workspace.36SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error)37// UpdateGitStatus updates the status of a repository in a workspace.38UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error)39}4041// NewIDEClientServiceClient constructs a client for the gitpod.experimental.v1.IDEClientService42// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for43// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply44// the connect.WithGRPC() or connect.WithGRPCWeb() options.45//46// The URL supplied here should be the base URL for the Connect or gRPC server (for example,47// http://api.acme.com or https://acme.com/grpc).48func NewIDEClientServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) IDEClientServiceClient {49baseURL = strings.TrimRight(baseURL, "/")50return &iDEClientServiceClient{51sendHeartbeat: connect_go.NewClient[v1.SendHeartbeatRequest, v1.SendHeartbeatResponse](52httpClient,53baseURL+"/gitpod.experimental.v1.IDEClientService/SendHeartbeat",54opts...,55),56sendDidClose: connect_go.NewClient[v1.SendDidCloseRequest, v1.SendDidCloseResponse](57httpClient,58baseURL+"/gitpod.experimental.v1.IDEClientService/SendDidClose",59opts...,60),61updateGitStatus: connect_go.NewClient[v1.UpdateGitStatusRequest, v1.UpdateGitStatusResponse](62httpClient,63baseURL+"/gitpod.experimental.v1.IDEClientService/UpdateGitStatus",64opts...,65),66}67}6869// iDEClientServiceClient implements IDEClientServiceClient.70type iDEClientServiceClient struct {71sendHeartbeat *connect_go.Client[v1.SendHeartbeatRequest, v1.SendHeartbeatResponse]72sendDidClose *connect_go.Client[v1.SendDidCloseRequest, v1.SendDidCloseResponse]73updateGitStatus *connect_go.Client[v1.UpdateGitStatusRequest, v1.UpdateGitStatusResponse]74}7576// SendHeartbeat calls gitpod.experimental.v1.IDEClientService.SendHeartbeat.77func (c *iDEClientServiceClient) SendHeartbeat(ctx context.Context, req *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error) {78return c.sendHeartbeat.CallUnary(ctx, req)79}8081// SendDidClose calls gitpod.experimental.v1.IDEClientService.SendDidClose.82func (c *iDEClientServiceClient) SendDidClose(ctx context.Context, req *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error) {83return c.sendDidClose.CallUnary(ctx, req)84}8586// UpdateGitStatus calls gitpod.experimental.v1.IDEClientService.UpdateGitStatus.87func (c *iDEClientServiceClient) UpdateGitStatus(ctx context.Context, req *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error) {88return c.updateGitStatus.CallUnary(ctx, req)89}9091// IDEClientServiceHandler is an implementation of the gitpod.experimental.v1.IDEClientService92// service.93type IDEClientServiceHandler interface {94// SendHeartbeat sends a clientheartbeat signal for a running workspace.95SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error)96// SendDidClose sends a client close signal for a running workspace.97SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error)98// UpdateGitStatus updates the status of a repository in a workspace.99UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error)100}101102// NewIDEClientServiceHandler builds an HTTP handler from the service implementation. It returns the103// path on which to mount the handler and the handler itself.104//105// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf106// and JSON codecs. They also support gzip compression.107func NewIDEClientServiceHandler(svc IDEClientServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {108mux := http.NewServeMux()109mux.Handle("/gitpod.experimental.v1.IDEClientService/SendHeartbeat", connect_go.NewUnaryHandler(110"/gitpod.experimental.v1.IDEClientService/SendHeartbeat",111svc.SendHeartbeat,112opts...,113))114mux.Handle("/gitpod.experimental.v1.IDEClientService/SendDidClose", connect_go.NewUnaryHandler(115"/gitpod.experimental.v1.IDEClientService/SendDidClose",116svc.SendDidClose,117opts...,118))119mux.Handle("/gitpod.experimental.v1.IDEClientService/UpdateGitStatus", connect_go.NewUnaryHandler(120"/gitpod.experimental.v1.IDEClientService/UpdateGitStatus",121svc.UpdateGitStatus,122opts...,123))124return "/gitpod.experimental.v1.IDEClientService/", mux125}126127// UnimplementedIDEClientServiceHandler returns CodeUnimplemented from all methods.128type UnimplementedIDEClientServiceHandler struct{}129130func (UnimplementedIDEClientServiceHandler) SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error) {131return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.SendHeartbeat is not implemented"))132}133134func (UnimplementedIDEClientServiceHandler) SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error) {135return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.SendDidClose is not implemented"))136}137138func (UnimplementedIDEClientServiceHandler) UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error) {139return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.UpdateGitStatus is not implemented"))140}141142143