Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/public-api/go/v1/v1connect/prebuild.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/v1/prebuild.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/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
// PrebuildServiceName is the fully-qualified name of the PrebuildService service.
29
PrebuildServiceName = "gitpod.v1.PrebuildService"
30
)
31
32
// PrebuildServiceClient is a client for the gitpod.v1.PrebuildService service.
33
type PrebuildServiceClient interface {
34
StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error)
35
CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error)
36
GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error)
37
ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error)
38
WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error)
39
// ListOrganizationPrebuilds lists all prebuilds of an organization
40
ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error)
41
}
42
43
// NewPrebuildServiceClient constructs a client for the gitpod.v1.PrebuildService service. By
44
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
45
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
46
// connect.WithGRPC() or connect.WithGRPCWeb() options.
47
//
48
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
49
// http://api.acme.com or https://acme.com/grpc).
50
func NewPrebuildServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) PrebuildServiceClient {
51
baseURL = strings.TrimRight(baseURL, "/")
52
return &prebuildServiceClient{
53
startPrebuild: connect_go.NewClient[v1.StartPrebuildRequest, v1.StartPrebuildResponse](
54
httpClient,
55
baseURL+"/gitpod.v1.PrebuildService/StartPrebuild",
56
opts...,
57
),
58
cancelPrebuild: connect_go.NewClient[v1.CancelPrebuildRequest, v1.CancelPrebuildResponse](
59
httpClient,
60
baseURL+"/gitpod.v1.PrebuildService/CancelPrebuild",
61
opts...,
62
),
63
getPrebuild: connect_go.NewClient[v1.GetPrebuildRequest, v1.GetPrebuildResponse](
64
httpClient,
65
baseURL+"/gitpod.v1.PrebuildService/GetPrebuild",
66
opts...,
67
),
68
listPrebuilds: connect_go.NewClient[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse](
69
httpClient,
70
baseURL+"/gitpod.v1.PrebuildService/ListPrebuilds",
71
opts...,
72
),
73
watchPrebuild: connect_go.NewClient[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse](
74
httpClient,
75
baseURL+"/gitpod.v1.PrebuildService/WatchPrebuild",
76
opts...,
77
),
78
listOrganizationPrebuilds: connect_go.NewClient[v1.ListOrganizationPrebuildsRequest, v1.ListOrganizationPrebuildsResponse](
79
httpClient,
80
baseURL+"/gitpod.v1.PrebuildService/ListOrganizationPrebuilds",
81
opts...,
82
),
83
}
84
}
85
86
// prebuildServiceClient implements PrebuildServiceClient.
87
type prebuildServiceClient struct {
88
startPrebuild *connect_go.Client[v1.StartPrebuildRequest, v1.StartPrebuildResponse]
89
cancelPrebuild *connect_go.Client[v1.CancelPrebuildRequest, v1.CancelPrebuildResponse]
90
getPrebuild *connect_go.Client[v1.GetPrebuildRequest, v1.GetPrebuildResponse]
91
listPrebuilds *connect_go.Client[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse]
92
watchPrebuild *connect_go.Client[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse]
93
listOrganizationPrebuilds *connect_go.Client[v1.ListOrganizationPrebuildsRequest, v1.ListOrganizationPrebuildsResponse]
94
}
95
96
// StartPrebuild calls gitpod.v1.PrebuildService.StartPrebuild.
97
func (c *prebuildServiceClient) StartPrebuild(ctx context.Context, req *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) {
98
return c.startPrebuild.CallUnary(ctx, req)
99
}
100
101
// CancelPrebuild calls gitpod.v1.PrebuildService.CancelPrebuild.
102
func (c *prebuildServiceClient) CancelPrebuild(ctx context.Context, req *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error) {
103
return c.cancelPrebuild.CallUnary(ctx, req)
104
}
105
106
// GetPrebuild calls gitpod.v1.PrebuildService.GetPrebuild.
107
func (c *prebuildServiceClient) GetPrebuild(ctx context.Context, req *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) {
108
return c.getPrebuild.CallUnary(ctx, req)
109
}
110
111
// ListPrebuilds calls gitpod.v1.PrebuildService.ListPrebuilds.
112
func (c *prebuildServiceClient) ListPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) {
113
return c.listPrebuilds.CallUnary(ctx, req)
114
}
115
116
// WatchPrebuild calls gitpod.v1.PrebuildService.WatchPrebuild.
117
func (c *prebuildServiceClient) WatchPrebuild(ctx context.Context, req *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error) {
118
return c.watchPrebuild.CallServerStream(ctx, req)
119
}
120
121
// ListOrganizationPrebuilds calls gitpod.v1.PrebuildService.ListOrganizationPrebuilds.
122
func (c *prebuildServiceClient) ListOrganizationPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error) {
123
return c.listOrganizationPrebuilds.CallUnary(ctx, req)
124
}
125
126
// PrebuildServiceHandler is an implementation of the gitpod.v1.PrebuildService service.
127
type PrebuildServiceHandler interface {
128
StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error)
129
CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error)
130
GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error)
131
ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error)
132
WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error
133
// ListOrganizationPrebuilds lists all prebuilds of an organization
134
ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error)
135
}
136
137
// NewPrebuildServiceHandler builds an HTTP handler from the service implementation. It returns the
138
// path on which to mount the handler and the handler itself.
139
//
140
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
141
// and JSON codecs. They also support gzip compression.
142
func NewPrebuildServiceHandler(svc PrebuildServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
143
mux := http.NewServeMux()
144
mux.Handle("/gitpod.v1.PrebuildService/StartPrebuild", connect_go.NewUnaryHandler(
145
"/gitpod.v1.PrebuildService/StartPrebuild",
146
svc.StartPrebuild,
147
opts...,
148
))
149
mux.Handle("/gitpod.v1.PrebuildService/CancelPrebuild", connect_go.NewUnaryHandler(
150
"/gitpod.v1.PrebuildService/CancelPrebuild",
151
svc.CancelPrebuild,
152
opts...,
153
))
154
mux.Handle("/gitpod.v1.PrebuildService/GetPrebuild", connect_go.NewUnaryHandler(
155
"/gitpod.v1.PrebuildService/GetPrebuild",
156
svc.GetPrebuild,
157
opts...,
158
))
159
mux.Handle("/gitpod.v1.PrebuildService/ListPrebuilds", connect_go.NewUnaryHandler(
160
"/gitpod.v1.PrebuildService/ListPrebuilds",
161
svc.ListPrebuilds,
162
opts...,
163
))
164
mux.Handle("/gitpod.v1.PrebuildService/WatchPrebuild", connect_go.NewServerStreamHandler(
165
"/gitpod.v1.PrebuildService/WatchPrebuild",
166
svc.WatchPrebuild,
167
opts...,
168
))
169
mux.Handle("/gitpod.v1.PrebuildService/ListOrganizationPrebuilds", connect_go.NewUnaryHandler(
170
"/gitpod.v1.PrebuildService/ListOrganizationPrebuilds",
171
svc.ListOrganizationPrebuilds,
172
opts...,
173
))
174
return "/gitpod.v1.PrebuildService/", mux
175
}
176
177
// UnimplementedPrebuildServiceHandler returns CodeUnimplemented from all methods.
178
type UnimplementedPrebuildServiceHandler struct{}
179
180
func (UnimplementedPrebuildServiceHandler) StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) {
181
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.StartPrebuild is not implemented"))
182
}
183
184
func (UnimplementedPrebuildServiceHandler) CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error) {
185
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.CancelPrebuild is not implemented"))
186
}
187
188
func (UnimplementedPrebuildServiceHandler) GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) {
189
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.GetPrebuild is not implemented"))
190
}
191
192
func (UnimplementedPrebuildServiceHandler) ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) {
193
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.ListPrebuilds is not implemented"))
194
}
195
196
func (UnimplementedPrebuildServiceHandler) WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error {
197
return connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.WatchPrebuild is not implemented"))
198
}
199
200
func (UnimplementedPrebuildServiceHandler) ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error) {
201
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.ListOrganizationPrebuilds is not implemented"))
202
}
203
204