Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/supervisor-api/go/control_grpc.pb.go
2498 views
1
// Copyright (c) 2024 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-go-grpc. DO NOT EDIT.
6
// versions:
7
// - protoc-gen-go-grpc v1.2.0
8
// - protoc v3.20.1
9
// source: control.proto
10
11
package api
12
13
import (
14
context "context"
15
grpc "google.golang.org/grpc"
16
codes "google.golang.org/grpc/codes"
17
status "google.golang.org/grpc/status"
18
)
19
20
// This is a compile-time assertion to ensure that this generated file
21
// is compatible with the grpc package it is being compiled against.
22
// Requires gRPC-Go v1.32.0 or later.
23
const _ = grpc.SupportPackageIsVersion7
24
25
// ControlServiceClient is the client API for ControlService service.
26
//
27
// 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.
28
type ControlServiceClient interface {
29
// ExposePort exposes a port
30
ExposePort(ctx context.Context, in *ExposePortRequest, opts ...grpc.CallOption) (*ExposePortResponse, error)
31
// CreateSSHKeyPair Create a pair of SSH Keys and put them in ~/.ssh/authorized_keys, this will only be generated once in the entire workspace lifecycle
32
CreateSSHKeyPair(ctx context.Context, in *CreateSSHKeyPairRequest, opts ...grpc.CallOption) (*CreateSSHKeyPairResponse, error)
33
// CreateDebugEnv creates a debug workspace envs
34
CreateDebugEnv(ctx context.Context, in *CreateDebugEnvRequest, opts ...grpc.CallOption) (*CreateDebugEnvResponse, error)
35
// SendHeartBeat sends a heartbeat to server to keep the workspace alive
36
SendHeartBeat(ctx context.Context, in *SendHeartBeatRequest, opts ...grpc.CallOption) (*SendHeartBeatResponse, error)
37
}
38
39
type controlServiceClient struct {
40
cc grpc.ClientConnInterface
41
}
42
43
func NewControlServiceClient(cc grpc.ClientConnInterface) ControlServiceClient {
44
return &controlServiceClient{cc}
45
}
46
47
func (c *controlServiceClient) ExposePort(ctx context.Context, in *ExposePortRequest, opts ...grpc.CallOption) (*ExposePortResponse, error) {
48
out := new(ExposePortResponse)
49
err := c.cc.Invoke(ctx, "/supervisor.ControlService/ExposePort", in, out, opts...)
50
if err != nil {
51
return nil, err
52
}
53
return out, nil
54
}
55
56
func (c *controlServiceClient) CreateSSHKeyPair(ctx context.Context, in *CreateSSHKeyPairRequest, opts ...grpc.CallOption) (*CreateSSHKeyPairResponse, error) {
57
out := new(CreateSSHKeyPairResponse)
58
err := c.cc.Invoke(ctx, "/supervisor.ControlService/CreateSSHKeyPair", in, out, opts...)
59
if err != nil {
60
return nil, err
61
}
62
return out, nil
63
}
64
65
func (c *controlServiceClient) CreateDebugEnv(ctx context.Context, in *CreateDebugEnvRequest, opts ...grpc.CallOption) (*CreateDebugEnvResponse, error) {
66
out := new(CreateDebugEnvResponse)
67
err := c.cc.Invoke(ctx, "/supervisor.ControlService/CreateDebugEnv", in, out, opts...)
68
if err != nil {
69
return nil, err
70
}
71
return out, nil
72
}
73
74
func (c *controlServiceClient) SendHeartBeat(ctx context.Context, in *SendHeartBeatRequest, opts ...grpc.CallOption) (*SendHeartBeatResponse, error) {
75
out := new(SendHeartBeatResponse)
76
err := c.cc.Invoke(ctx, "/supervisor.ControlService/SendHeartBeat", in, out, opts...)
77
if err != nil {
78
return nil, err
79
}
80
return out, nil
81
}
82
83
// ControlServiceServer is the server API for ControlService service.
84
// All implementations must embed UnimplementedControlServiceServer
85
// for forward compatibility
86
type ControlServiceServer interface {
87
// ExposePort exposes a port
88
ExposePort(context.Context, *ExposePortRequest) (*ExposePortResponse, error)
89
// CreateSSHKeyPair Create a pair of SSH Keys and put them in ~/.ssh/authorized_keys, this will only be generated once in the entire workspace lifecycle
90
CreateSSHKeyPair(context.Context, *CreateSSHKeyPairRequest) (*CreateSSHKeyPairResponse, error)
91
// CreateDebugEnv creates a debug workspace envs
92
CreateDebugEnv(context.Context, *CreateDebugEnvRequest) (*CreateDebugEnvResponse, error)
93
// SendHeartBeat sends a heartbeat to server to keep the workspace alive
94
SendHeartBeat(context.Context, *SendHeartBeatRequest) (*SendHeartBeatResponse, error)
95
mustEmbedUnimplementedControlServiceServer()
96
}
97
98
// UnimplementedControlServiceServer must be embedded to have forward compatible implementations.
99
type UnimplementedControlServiceServer struct {
100
}
101
102
func (UnimplementedControlServiceServer) ExposePort(context.Context, *ExposePortRequest) (*ExposePortResponse, error) {
103
return nil, status.Errorf(codes.Unimplemented, "method ExposePort not implemented")
104
}
105
func (UnimplementedControlServiceServer) CreateSSHKeyPair(context.Context, *CreateSSHKeyPairRequest) (*CreateSSHKeyPairResponse, error) {
106
return nil, status.Errorf(codes.Unimplemented, "method CreateSSHKeyPair not implemented")
107
}
108
func (UnimplementedControlServiceServer) CreateDebugEnv(context.Context, *CreateDebugEnvRequest) (*CreateDebugEnvResponse, error) {
109
return nil, status.Errorf(codes.Unimplemented, "method CreateDebugEnv not implemented")
110
}
111
func (UnimplementedControlServiceServer) SendHeartBeat(context.Context, *SendHeartBeatRequest) (*SendHeartBeatResponse, error) {
112
return nil, status.Errorf(codes.Unimplemented, "method SendHeartBeat not implemented")
113
}
114
func (UnimplementedControlServiceServer) mustEmbedUnimplementedControlServiceServer() {}
115
116
// UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service.
117
// Use of this interface is not recommended, as added methods to ControlServiceServer will
118
// result in compilation errors.
119
type UnsafeControlServiceServer interface {
120
mustEmbedUnimplementedControlServiceServer()
121
}
122
123
func RegisterControlServiceServer(s grpc.ServiceRegistrar, srv ControlServiceServer) {
124
s.RegisterService(&ControlService_ServiceDesc, srv)
125
}
126
127
func _ControlService_ExposePort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
128
in := new(ExposePortRequest)
129
if err := dec(in); err != nil {
130
return nil, err
131
}
132
if interceptor == nil {
133
return srv.(ControlServiceServer).ExposePort(ctx, in)
134
}
135
info := &grpc.UnaryServerInfo{
136
Server: srv,
137
FullMethod: "/supervisor.ControlService/ExposePort",
138
}
139
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
140
return srv.(ControlServiceServer).ExposePort(ctx, req.(*ExposePortRequest))
141
}
142
return interceptor(ctx, in, info, handler)
143
}
144
145
func _ControlService_CreateSSHKeyPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
146
in := new(CreateSSHKeyPairRequest)
147
if err := dec(in); err != nil {
148
return nil, err
149
}
150
if interceptor == nil {
151
return srv.(ControlServiceServer).CreateSSHKeyPair(ctx, in)
152
}
153
info := &grpc.UnaryServerInfo{
154
Server: srv,
155
FullMethod: "/supervisor.ControlService/CreateSSHKeyPair",
156
}
157
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
158
return srv.(ControlServiceServer).CreateSSHKeyPair(ctx, req.(*CreateSSHKeyPairRequest))
159
}
160
return interceptor(ctx, in, info, handler)
161
}
162
163
func _ControlService_CreateDebugEnv_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
164
in := new(CreateDebugEnvRequest)
165
if err := dec(in); err != nil {
166
return nil, err
167
}
168
if interceptor == nil {
169
return srv.(ControlServiceServer).CreateDebugEnv(ctx, in)
170
}
171
info := &grpc.UnaryServerInfo{
172
Server: srv,
173
FullMethod: "/supervisor.ControlService/CreateDebugEnv",
174
}
175
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
176
return srv.(ControlServiceServer).CreateDebugEnv(ctx, req.(*CreateDebugEnvRequest))
177
}
178
return interceptor(ctx, in, info, handler)
179
}
180
181
func _ControlService_SendHeartBeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
182
in := new(SendHeartBeatRequest)
183
if err := dec(in); err != nil {
184
return nil, err
185
}
186
if interceptor == nil {
187
return srv.(ControlServiceServer).SendHeartBeat(ctx, in)
188
}
189
info := &grpc.UnaryServerInfo{
190
Server: srv,
191
FullMethod: "/supervisor.ControlService/SendHeartBeat",
192
}
193
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
194
return srv.(ControlServiceServer).SendHeartBeat(ctx, req.(*SendHeartBeatRequest))
195
}
196
return interceptor(ctx, in, info, handler)
197
}
198
199
// ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service.
200
// It's only intended for direct use with grpc.RegisterService,
201
// and not to be introspected or modified (even as a copy)
202
var ControlService_ServiceDesc = grpc.ServiceDesc{
203
ServiceName: "supervisor.ControlService",
204
HandlerType: (*ControlServiceServer)(nil),
205
Methods: []grpc.MethodDesc{
206
{
207
MethodName: "ExposePort",
208
Handler: _ControlService_ExposePort_Handler,
209
},
210
{
211
MethodName: "CreateSSHKeyPair",
212
Handler: _ControlService_CreateSSHKeyPair_Handler,
213
},
214
{
215
MethodName: "CreateDebugEnv",
216
Handler: _ControlService_CreateDebugEnv_Handler,
217
},
218
{
219
MethodName: "SendHeartBeat",
220
Handler: _ControlService_SendHeartBeat_Handler,
221
},
222
},
223
Streams: []grpc.StreamDesc{},
224
Metadata: "control.proto",
225
}
226
227