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/editor_service.connect.go
2506 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/editor_service.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
// EditorServiceName is the fully-qualified name of the EditorService service.
29
EditorServiceName = "gitpod.experimental.v1.EditorService"
30
)
31
32
// EditorServiceClient is a client for the gitpod.experimental.v1.EditorService service.
33
type EditorServiceClient interface {
34
ListEditorOptions(context.Context, *connect_go.Request[v1.ListEditorOptionsRequest]) (*connect_go.Response[v1.ListEditorOptionsResponse], error)
35
}
36
37
// NewEditorServiceClient constructs a client for the gitpod.experimental.v1.EditorService service.
38
// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
39
// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
40
// connect.WithGRPC() or connect.WithGRPCWeb() options.
41
//
42
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
43
// http://api.acme.com or https://acme.com/grpc).
44
func NewEditorServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) EditorServiceClient {
45
baseURL = strings.TrimRight(baseURL, "/")
46
return &editorServiceClient{
47
listEditorOptions: connect_go.NewClient[v1.ListEditorOptionsRequest, v1.ListEditorOptionsResponse](
48
httpClient,
49
baseURL+"/gitpod.experimental.v1.EditorService/ListEditorOptions",
50
opts...,
51
),
52
}
53
}
54
55
// editorServiceClient implements EditorServiceClient.
56
type editorServiceClient struct {
57
listEditorOptions *connect_go.Client[v1.ListEditorOptionsRequest, v1.ListEditorOptionsResponse]
58
}
59
60
// ListEditorOptions calls gitpod.experimental.v1.EditorService.ListEditorOptions.
61
func (c *editorServiceClient) ListEditorOptions(ctx context.Context, req *connect_go.Request[v1.ListEditorOptionsRequest]) (*connect_go.Response[v1.ListEditorOptionsResponse], error) {
62
return c.listEditorOptions.CallUnary(ctx, req)
63
}
64
65
// EditorServiceHandler is an implementation of the gitpod.experimental.v1.EditorService service.
66
type EditorServiceHandler interface {
67
ListEditorOptions(context.Context, *connect_go.Request[v1.ListEditorOptionsRequest]) (*connect_go.Response[v1.ListEditorOptionsResponse], error)
68
}
69
70
// NewEditorServiceHandler builds an HTTP handler from the service implementation. It returns the
71
// path on which to mount the handler and the handler itself.
72
//
73
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
74
// and JSON codecs. They also support gzip compression.
75
func NewEditorServiceHandler(svc EditorServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
76
mux := http.NewServeMux()
77
mux.Handle("/gitpod.experimental.v1.EditorService/ListEditorOptions", connect_go.NewUnaryHandler(
78
"/gitpod.experimental.v1.EditorService/ListEditorOptions",
79
svc.ListEditorOptions,
80
opts...,
81
))
82
return "/gitpod.experimental.v1.EditorService/", mux
83
}
84
85
// UnimplementedEditorServiceHandler returns CodeUnimplemented from all methods.
86
type UnimplementedEditorServiceHandler struct{}
87
88
func (UnimplementedEditorServiceHandler) ListEditorOptions(context.Context, *connect_go.Request[v1.ListEditorOptionsRequest]) (*connect_go.Response[v1.ListEditorOptionsResponse], error) {
89
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.EditorService.ListEditorOptions is not implemented"))
90
}
91
92