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