Path: blob/main/components/supervisor-api/go/control_grpc.pb.go
2498 views
// Copyright (c) 2024 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-go-grpc. DO NOT EDIT.5// versions:6// - protoc-gen-go-grpc v1.2.07// - protoc v3.20.18// source: control.proto910package api1112import (13context "context"14grpc "google.golang.org/grpc"15codes "google.golang.org/grpc/codes"16status "google.golang.org/grpc/status"17)1819// This is a compile-time assertion to ensure that this generated file20// is compatible with the grpc package it is being compiled against.21// Requires gRPC-Go v1.32.0 or later.22const _ = grpc.SupportPackageIsVersion72324// ControlServiceClient is the client API for ControlService service.25//26// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.27type ControlServiceClient interface {28// ExposePort exposes a port29ExposePort(ctx context.Context, in *ExposePortRequest, opts ...grpc.CallOption) (*ExposePortResponse, error)30// CreateSSHKeyPair Create a pair of SSH Keys and put them in ~/.ssh/authorized_keys, this will only be generated once in the entire workspace lifecycle31CreateSSHKeyPair(ctx context.Context, in *CreateSSHKeyPairRequest, opts ...grpc.CallOption) (*CreateSSHKeyPairResponse, error)32// CreateDebugEnv creates a debug workspace envs33CreateDebugEnv(ctx context.Context, in *CreateDebugEnvRequest, opts ...grpc.CallOption) (*CreateDebugEnvResponse, error)34// SendHeartBeat sends a heartbeat to server to keep the workspace alive35SendHeartBeat(ctx context.Context, in *SendHeartBeatRequest, opts ...grpc.CallOption) (*SendHeartBeatResponse, error)36}3738type controlServiceClient struct {39cc grpc.ClientConnInterface40}4142func NewControlServiceClient(cc grpc.ClientConnInterface) ControlServiceClient {43return &controlServiceClient{cc}44}4546func (c *controlServiceClient) ExposePort(ctx context.Context, in *ExposePortRequest, opts ...grpc.CallOption) (*ExposePortResponse, error) {47out := new(ExposePortResponse)48err := c.cc.Invoke(ctx, "/supervisor.ControlService/ExposePort", in, out, opts...)49if err != nil {50return nil, err51}52return out, nil53}5455func (c *controlServiceClient) CreateSSHKeyPair(ctx context.Context, in *CreateSSHKeyPairRequest, opts ...grpc.CallOption) (*CreateSSHKeyPairResponse, error) {56out := new(CreateSSHKeyPairResponse)57err := c.cc.Invoke(ctx, "/supervisor.ControlService/CreateSSHKeyPair", in, out, opts...)58if err != nil {59return nil, err60}61return out, nil62}6364func (c *controlServiceClient) CreateDebugEnv(ctx context.Context, in *CreateDebugEnvRequest, opts ...grpc.CallOption) (*CreateDebugEnvResponse, error) {65out := new(CreateDebugEnvResponse)66err := c.cc.Invoke(ctx, "/supervisor.ControlService/CreateDebugEnv", in, out, opts...)67if err != nil {68return nil, err69}70return out, nil71}7273func (c *controlServiceClient) SendHeartBeat(ctx context.Context, in *SendHeartBeatRequest, opts ...grpc.CallOption) (*SendHeartBeatResponse, error) {74out := new(SendHeartBeatResponse)75err := c.cc.Invoke(ctx, "/supervisor.ControlService/SendHeartBeat", in, out, opts...)76if err != nil {77return nil, err78}79return out, nil80}8182// ControlServiceServer is the server API for ControlService service.83// All implementations must embed UnimplementedControlServiceServer84// for forward compatibility85type ControlServiceServer interface {86// ExposePort exposes a port87ExposePort(context.Context, *ExposePortRequest) (*ExposePortResponse, error)88// CreateSSHKeyPair Create a pair of SSH Keys and put them in ~/.ssh/authorized_keys, this will only be generated once in the entire workspace lifecycle89CreateSSHKeyPair(context.Context, *CreateSSHKeyPairRequest) (*CreateSSHKeyPairResponse, error)90// CreateDebugEnv creates a debug workspace envs91CreateDebugEnv(context.Context, *CreateDebugEnvRequest) (*CreateDebugEnvResponse, error)92// SendHeartBeat sends a heartbeat to server to keep the workspace alive93SendHeartBeat(context.Context, *SendHeartBeatRequest) (*SendHeartBeatResponse, error)94mustEmbedUnimplementedControlServiceServer()95}9697// UnimplementedControlServiceServer must be embedded to have forward compatible implementations.98type UnimplementedControlServiceServer struct {99}100101func (UnimplementedControlServiceServer) ExposePort(context.Context, *ExposePortRequest) (*ExposePortResponse, error) {102return nil, status.Errorf(codes.Unimplemented, "method ExposePort not implemented")103}104func (UnimplementedControlServiceServer) CreateSSHKeyPair(context.Context, *CreateSSHKeyPairRequest) (*CreateSSHKeyPairResponse, error) {105return nil, status.Errorf(codes.Unimplemented, "method CreateSSHKeyPair not implemented")106}107func (UnimplementedControlServiceServer) CreateDebugEnv(context.Context, *CreateDebugEnvRequest) (*CreateDebugEnvResponse, error) {108return nil, status.Errorf(codes.Unimplemented, "method CreateDebugEnv not implemented")109}110func (UnimplementedControlServiceServer) SendHeartBeat(context.Context, *SendHeartBeatRequest) (*SendHeartBeatResponse, error) {111return nil, status.Errorf(codes.Unimplemented, "method SendHeartBeat not implemented")112}113func (UnimplementedControlServiceServer) mustEmbedUnimplementedControlServiceServer() {}114115// UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service.116// Use of this interface is not recommended, as added methods to ControlServiceServer will117// result in compilation errors.118type UnsafeControlServiceServer interface {119mustEmbedUnimplementedControlServiceServer()120}121122func RegisterControlServiceServer(s grpc.ServiceRegistrar, srv ControlServiceServer) {123s.RegisterService(&ControlService_ServiceDesc, srv)124}125126func _ControlService_ExposePort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {127in := new(ExposePortRequest)128if err := dec(in); err != nil {129return nil, err130}131if interceptor == nil {132return srv.(ControlServiceServer).ExposePort(ctx, in)133}134info := &grpc.UnaryServerInfo{135Server: srv,136FullMethod: "/supervisor.ControlService/ExposePort",137}138handler := func(ctx context.Context, req interface{}) (interface{}, error) {139return srv.(ControlServiceServer).ExposePort(ctx, req.(*ExposePortRequest))140}141return interceptor(ctx, in, info, handler)142}143144func _ControlService_CreateSSHKeyPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {145in := new(CreateSSHKeyPairRequest)146if err := dec(in); err != nil {147return nil, err148}149if interceptor == nil {150return srv.(ControlServiceServer).CreateSSHKeyPair(ctx, in)151}152info := &grpc.UnaryServerInfo{153Server: srv,154FullMethod: "/supervisor.ControlService/CreateSSHKeyPair",155}156handler := func(ctx context.Context, req interface{}) (interface{}, error) {157return srv.(ControlServiceServer).CreateSSHKeyPair(ctx, req.(*CreateSSHKeyPairRequest))158}159return interceptor(ctx, in, info, handler)160}161162func _ControlService_CreateDebugEnv_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {163in := new(CreateDebugEnvRequest)164if err := dec(in); err != nil {165return nil, err166}167if interceptor == nil {168return srv.(ControlServiceServer).CreateDebugEnv(ctx, in)169}170info := &grpc.UnaryServerInfo{171Server: srv,172FullMethod: "/supervisor.ControlService/CreateDebugEnv",173}174handler := func(ctx context.Context, req interface{}) (interface{}, error) {175return srv.(ControlServiceServer).CreateDebugEnv(ctx, req.(*CreateDebugEnvRequest))176}177return interceptor(ctx, in, info, handler)178}179180func _ControlService_SendHeartBeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {181in := new(SendHeartBeatRequest)182if err := dec(in); err != nil {183return nil, err184}185if interceptor == nil {186return srv.(ControlServiceServer).SendHeartBeat(ctx, in)187}188info := &grpc.UnaryServerInfo{189Server: srv,190FullMethod: "/supervisor.ControlService/SendHeartBeat",191}192handler := func(ctx context.Context, req interface{}) (interface{}, error) {193return srv.(ControlServiceServer).SendHeartBeat(ctx, req.(*SendHeartBeatRequest))194}195return interceptor(ctx, in, info, handler)196}197198// ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service.199// It's only intended for direct use with grpc.RegisterService,200// and not to be introspected or modified (even as a copy)201var ControlService_ServiceDesc = grpc.ServiceDesc{202ServiceName: "supervisor.ControlService",203HandlerType: (*ControlServiceServer)(nil),204Methods: []grpc.MethodDesc{205{206MethodName: "ExposePort",207Handler: _ControlService_ExposePort_Handler,208},209{210MethodName: "CreateSSHKeyPair",211Handler: _ControlService_CreateSSHKeyPair_Handler,212},213{214MethodName: "CreateDebugEnv",215Handler: _ControlService_CreateDebugEnv_Handler,216},217{218MethodName: "SendHeartBeat",219Handler: _ControlService_SendHeartBeat_Handler,220},221},222Streams: []grpc.StreamDesc{},223Metadata: "control.proto",224}225226227