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/configuration.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/configuration.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
// ConfigurationServiceName is the fully-qualified name of the ConfigurationService service.
29
ConfigurationServiceName = "gitpod.v1.ConfigurationService"
30
)
31
32
// ConfigurationServiceClient is a client for the gitpod.v1.ConfigurationService service.
33
type ConfigurationServiceClient interface {
34
// Creates a new configuration.
35
CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error)
36
// Retrieves a configuration.
37
GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error)
38
// Lists configurations.
39
ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error)
40
// Updates a configuration.
41
UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error)
42
// Deletes a configuration.
43
DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error)
44
}
45
46
// NewConfigurationServiceClient constructs a client for the gitpod.v1.ConfigurationService service.
47
// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
48
// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
49
// connect.WithGRPC() or connect.WithGRPCWeb() options.
50
//
51
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
52
// http://api.acme.com or https://acme.com/grpc).
53
func NewConfigurationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) ConfigurationServiceClient {
54
baseURL = strings.TrimRight(baseURL, "/")
55
return &configurationServiceClient{
56
createConfiguration: connect_go.NewClient[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse](
57
httpClient,
58
baseURL+"/gitpod.v1.ConfigurationService/CreateConfiguration",
59
opts...,
60
),
61
getConfiguration: connect_go.NewClient[v1.GetConfigurationRequest, v1.GetConfigurationResponse](
62
httpClient,
63
baseURL+"/gitpod.v1.ConfigurationService/GetConfiguration",
64
opts...,
65
),
66
listConfigurations: connect_go.NewClient[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse](
67
httpClient,
68
baseURL+"/gitpod.v1.ConfigurationService/ListConfigurations",
69
opts...,
70
),
71
updateConfiguration: connect_go.NewClient[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse](
72
httpClient,
73
baseURL+"/gitpod.v1.ConfigurationService/UpdateConfiguration",
74
opts...,
75
),
76
deleteConfiguration: connect_go.NewClient[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse](
77
httpClient,
78
baseURL+"/gitpod.v1.ConfigurationService/DeleteConfiguration",
79
opts...,
80
),
81
}
82
}
83
84
// configurationServiceClient implements ConfigurationServiceClient.
85
type configurationServiceClient struct {
86
createConfiguration *connect_go.Client[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse]
87
getConfiguration *connect_go.Client[v1.GetConfigurationRequest, v1.GetConfigurationResponse]
88
listConfigurations *connect_go.Client[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse]
89
updateConfiguration *connect_go.Client[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse]
90
deleteConfiguration *connect_go.Client[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse]
91
}
92
93
// CreateConfiguration calls gitpod.v1.ConfigurationService.CreateConfiguration.
94
func (c *configurationServiceClient) CreateConfiguration(ctx context.Context, req *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error) {
95
return c.createConfiguration.CallUnary(ctx, req)
96
}
97
98
// GetConfiguration calls gitpod.v1.ConfigurationService.GetConfiguration.
99
func (c *configurationServiceClient) GetConfiguration(ctx context.Context, req *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error) {
100
return c.getConfiguration.CallUnary(ctx, req)
101
}
102
103
// ListConfigurations calls gitpod.v1.ConfigurationService.ListConfigurations.
104
func (c *configurationServiceClient) ListConfigurations(ctx context.Context, req *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error) {
105
return c.listConfigurations.CallUnary(ctx, req)
106
}
107
108
// UpdateConfiguration calls gitpod.v1.ConfigurationService.UpdateConfiguration.
109
func (c *configurationServiceClient) UpdateConfiguration(ctx context.Context, req *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) {
110
return c.updateConfiguration.CallUnary(ctx, req)
111
}
112
113
// DeleteConfiguration calls gitpod.v1.ConfigurationService.DeleteConfiguration.
114
func (c *configurationServiceClient) DeleteConfiguration(ctx context.Context, req *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) {
115
return c.deleteConfiguration.CallUnary(ctx, req)
116
}
117
118
// ConfigurationServiceHandler is an implementation of the gitpod.v1.ConfigurationService service.
119
type ConfigurationServiceHandler interface {
120
// Creates a new configuration.
121
CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error)
122
// Retrieves a configuration.
123
GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error)
124
// Lists configurations.
125
ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error)
126
// Updates a configuration.
127
UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error)
128
// Deletes a configuration.
129
DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error)
130
}
131
132
// NewConfigurationServiceHandler builds an HTTP handler from the service implementation. It returns
133
// the path on which to mount the handler and the handler itself.
134
//
135
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
136
// and JSON codecs. They also support gzip compression.
137
func NewConfigurationServiceHandler(svc ConfigurationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
138
mux := http.NewServeMux()
139
mux.Handle("/gitpod.v1.ConfigurationService/CreateConfiguration", connect_go.NewUnaryHandler(
140
"/gitpod.v1.ConfigurationService/CreateConfiguration",
141
svc.CreateConfiguration,
142
opts...,
143
))
144
mux.Handle("/gitpod.v1.ConfigurationService/GetConfiguration", connect_go.NewUnaryHandler(
145
"/gitpod.v1.ConfigurationService/GetConfiguration",
146
svc.GetConfiguration,
147
opts...,
148
))
149
mux.Handle("/gitpod.v1.ConfigurationService/ListConfigurations", connect_go.NewUnaryHandler(
150
"/gitpod.v1.ConfigurationService/ListConfigurations",
151
svc.ListConfigurations,
152
opts...,
153
))
154
mux.Handle("/gitpod.v1.ConfigurationService/UpdateConfiguration", connect_go.NewUnaryHandler(
155
"/gitpod.v1.ConfigurationService/UpdateConfiguration",
156
svc.UpdateConfiguration,
157
opts...,
158
))
159
mux.Handle("/gitpod.v1.ConfigurationService/DeleteConfiguration", connect_go.NewUnaryHandler(
160
"/gitpod.v1.ConfigurationService/DeleteConfiguration",
161
svc.DeleteConfiguration,
162
opts...,
163
))
164
return "/gitpod.v1.ConfigurationService/", mux
165
}
166
167
// UnimplementedConfigurationServiceHandler returns CodeUnimplemented from all methods.
168
type UnimplementedConfigurationServiceHandler struct{}
169
170
func (UnimplementedConfigurationServiceHandler) CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error) {
171
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.CreateConfiguration is not implemented"))
172
}
173
174
func (UnimplementedConfigurationServiceHandler) GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error) {
175
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.GetConfiguration is not implemented"))
176
}
177
178
func (UnimplementedConfigurationServiceHandler) ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error) {
179
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.ListConfigurations is not implemented"))
180
}
181
182
func (UnimplementedConfigurationServiceHandler) UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) {
183
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.UpdateConfiguration is not implemented"))
184
}
185
186
func (UnimplementedConfigurationServiceHandler) DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) {
187
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.DeleteConfiguration is not implemented"))
188
}
189
190