Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/public-api/go/experimental/v1/v1connect/ide_client.connect.go
2501 views
1
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
6
//
7
// Source: gitpod/experimental/v1/ide_client.proto
8
9
package v1connect
10
11
import (
12
context "context"
13
errors "errors"
14
connect_go "github.com/bufbuild/connect-go"
15
v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1"
16
http "net/http"
17
strings "strings"
18
)
19
20
// This is a compile-time assertion to ensure that this generated file and the connect package are
21
// compatible. If you get a compiler error that this constant is not defined, this code was
22
// generated with a version of connect newer than the one compiled into your binary. You can fix the
23
// problem by either regenerating this code with an older version of connect or updating the connect
24
// version compiled into your binary.
25
const _ = connect_go.IsAtLeastVersion0_1_0
26
27
const (
28
// IDEClientServiceName is the fully-qualified name of the IDEClientService service.
29
IDEClientServiceName = "gitpod.experimental.v1.IDEClientService"
30
)
31
32
// IDEClientServiceClient is a client for the gitpod.experimental.v1.IDEClientService service.
33
type IDEClientServiceClient interface {
34
// SendHeartbeat sends a clientheartbeat signal for a running workspace.
35
SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error)
36
// SendDidClose sends a client close signal for a running workspace.
37
SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error)
38
// UpdateGitStatus updates the status of a repository in a workspace.
39
UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error)
40
}
41
42
// NewIDEClientServiceClient constructs a client for the gitpod.experimental.v1.IDEClientService
43
// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for
44
// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply
45
// the connect.WithGRPC() or connect.WithGRPCWeb() options.
46
//
47
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
48
// http://api.acme.com or https://acme.com/grpc).
49
func NewIDEClientServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) IDEClientServiceClient {
50
baseURL = strings.TrimRight(baseURL, "/")
51
return &iDEClientServiceClient{
52
sendHeartbeat: connect_go.NewClient[v1.SendHeartbeatRequest, v1.SendHeartbeatResponse](
53
httpClient,
54
baseURL+"/gitpod.experimental.v1.IDEClientService/SendHeartbeat",
55
opts...,
56
),
57
sendDidClose: connect_go.NewClient[v1.SendDidCloseRequest, v1.SendDidCloseResponse](
58
httpClient,
59
baseURL+"/gitpod.experimental.v1.IDEClientService/SendDidClose",
60
opts...,
61
),
62
updateGitStatus: connect_go.NewClient[v1.UpdateGitStatusRequest, v1.UpdateGitStatusResponse](
63
httpClient,
64
baseURL+"/gitpod.experimental.v1.IDEClientService/UpdateGitStatus",
65
opts...,
66
),
67
}
68
}
69
70
// iDEClientServiceClient implements IDEClientServiceClient.
71
type iDEClientServiceClient struct {
72
sendHeartbeat *connect_go.Client[v1.SendHeartbeatRequest, v1.SendHeartbeatResponse]
73
sendDidClose *connect_go.Client[v1.SendDidCloseRequest, v1.SendDidCloseResponse]
74
updateGitStatus *connect_go.Client[v1.UpdateGitStatusRequest, v1.UpdateGitStatusResponse]
75
}
76
77
// SendHeartbeat calls gitpod.experimental.v1.IDEClientService.SendHeartbeat.
78
func (c *iDEClientServiceClient) SendHeartbeat(ctx context.Context, req *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error) {
79
return c.sendHeartbeat.CallUnary(ctx, req)
80
}
81
82
// SendDidClose calls gitpod.experimental.v1.IDEClientService.SendDidClose.
83
func (c *iDEClientServiceClient) SendDidClose(ctx context.Context, req *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error) {
84
return c.sendDidClose.CallUnary(ctx, req)
85
}
86
87
// UpdateGitStatus calls gitpod.experimental.v1.IDEClientService.UpdateGitStatus.
88
func (c *iDEClientServiceClient) UpdateGitStatus(ctx context.Context, req *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error) {
89
return c.updateGitStatus.CallUnary(ctx, req)
90
}
91
92
// IDEClientServiceHandler is an implementation of the gitpod.experimental.v1.IDEClientService
93
// service.
94
type IDEClientServiceHandler interface {
95
// SendHeartbeat sends a clientheartbeat signal for a running workspace.
96
SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error)
97
// SendDidClose sends a client close signal for a running workspace.
98
SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error)
99
// UpdateGitStatus updates the status of a repository in a workspace.
100
UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error)
101
}
102
103
// NewIDEClientServiceHandler builds an HTTP handler from the service implementation. It returns the
104
// path on which to mount the handler and the handler itself.
105
//
106
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
107
// and JSON codecs. They also support gzip compression.
108
func NewIDEClientServiceHandler(svc IDEClientServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
109
mux := http.NewServeMux()
110
mux.Handle("/gitpod.experimental.v1.IDEClientService/SendHeartbeat", connect_go.NewUnaryHandler(
111
"/gitpod.experimental.v1.IDEClientService/SendHeartbeat",
112
svc.SendHeartbeat,
113
opts...,
114
))
115
mux.Handle("/gitpod.experimental.v1.IDEClientService/SendDidClose", connect_go.NewUnaryHandler(
116
"/gitpod.experimental.v1.IDEClientService/SendDidClose",
117
svc.SendDidClose,
118
opts...,
119
))
120
mux.Handle("/gitpod.experimental.v1.IDEClientService/UpdateGitStatus", connect_go.NewUnaryHandler(
121
"/gitpod.experimental.v1.IDEClientService/UpdateGitStatus",
122
svc.UpdateGitStatus,
123
opts...,
124
))
125
return "/gitpod.experimental.v1.IDEClientService/", mux
126
}
127
128
// UnimplementedIDEClientServiceHandler returns CodeUnimplemented from all methods.
129
type UnimplementedIDEClientServiceHandler struct{}
130
131
func (UnimplementedIDEClientServiceHandler) SendHeartbeat(context.Context, *connect_go.Request[v1.SendHeartbeatRequest]) (*connect_go.Response[v1.SendHeartbeatResponse], error) {
132
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.SendHeartbeat is not implemented"))
133
}
134
135
func (UnimplementedIDEClientServiceHandler) SendDidClose(context.Context, *connect_go.Request[v1.SendDidCloseRequest]) (*connect_go.Response[v1.SendDidCloseResponse], error) {
136
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.SendDidClose is not implemented"))
137
}
138
139
func (UnimplementedIDEClientServiceHandler) UpdateGitStatus(context.Context, *connect_go.Request[v1.UpdateGitStatusRequest]) (*connect_go.Response[v1.UpdateGitStatusResponse], error) {
140
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IDEClientService.UpdateGitStatus is not implemented"))
141
}
142
143