Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/supervisor-api/go/port_grpc.pb.go
2498 views
1
// Copyright (c) 2023 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: port.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
// PortServiceClient is the client API for PortService 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 PortServiceClient interface {
29
// Tunnel notifies clients to install listeners on remote machines.
30
// After that such clients should call EstablishTunnel to forward incoming connections.
31
Tunnel(ctx context.Context, in *TunnelPortRequest, opts ...grpc.CallOption) (*TunnelPortResponse, error)
32
// CloseTunnel notifies clients to remove listeners on remote machines.
33
CloseTunnel(ctx context.Context, in *CloseTunnelRequest, opts ...grpc.CallOption) (*CloseTunnelResponse, error)
34
// EstablishTunnel actually establishes the tunnel for an incoming connection on a remote machine.
35
EstablishTunnel(ctx context.Context, opts ...grpc.CallOption) (PortService_EstablishTunnelClient, error)
36
// AutoTunnel controls enablement of auto tunneling
37
AutoTunnel(ctx context.Context, in *AutoTunnelRequest, opts ...grpc.CallOption) (*AutoTunnelResponse, error)
38
// RetryAutoExpose retries auto exposing the give port
39
RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error)
40
}
41
42
type portServiceClient struct {
43
cc grpc.ClientConnInterface
44
}
45
46
func NewPortServiceClient(cc grpc.ClientConnInterface) PortServiceClient {
47
return &portServiceClient{cc}
48
}
49
50
func (c *portServiceClient) Tunnel(ctx context.Context, in *TunnelPortRequest, opts ...grpc.CallOption) (*TunnelPortResponse, error) {
51
out := new(TunnelPortResponse)
52
err := c.cc.Invoke(ctx, "/supervisor.PortService/Tunnel", in, out, opts...)
53
if err != nil {
54
return nil, err
55
}
56
return out, nil
57
}
58
59
func (c *portServiceClient) CloseTunnel(ctx context.Context, in *CloseTunnelRequest, opts ...grpc.CallOption) (*CloseTunnelResponse, error) {
60
out := new(CloseTunnelResponse)
61
err := c.cc.Invoke(ctx, "/supervisor.PortService/CloseTunnel", in, out, opts...)
62
if err != nil {
63
return nil, err
64
}
65
return out, nil
66
}
67
68
func (c *portServiceClient) EstablishTunnel(ctx context.Context, opts ...grpc.CallOption) (PortService_EstablishTunnelClient, error) {
69
stream, err := c.cc.NewStream(ctx, &PortService_ServiceDesc.Streams[0], "/supervisor.PortService/EstablishTunnel", opts...)
70
if err != nil {
71
return nil, err
72
}
73
x := &portServiceEstablishTunnelClient{stream}
74
return x, nil
75
}
76
77
type PortService_EstablishTunnelClient interface {
78
Send(*EstablishTunnelRequest) error
79
Recv() (*EstablishTunnelResponse, error)
80
grpc.ClientStream
81
}
82
83
type portServiceEstablishTunnelClient struct {
84
grpc.ClientStream
85
}
86
87
func (x *portServiceEstablishTunnelClient) Send(m *EstablishTunnelRequest) error {
88
return x.ClientStream.SendMsg(m)
89
}
90
91
func (x *portServiceEstablishTunnelClient) Recv() (*EstablishTunnelResponse, error) {
92
m := new(EstablishTunnelResponse)
93
if err := x.ClientStream.RecvMsg(m); err != nil {
94
return nil, err
95
}
96
return m, nil
97
}
98
99
func (c *portServiceClient) AutoTunnel(ctx context.Context, in *AutoTunnelRequest, opts ...grpc.CallOption) (*AutoTunnelResponse, error) {
100
out := new(AutoTunnelResponse)
101
err := c.cc.Invoke(ctx, "/supervisor.PortService/AutoTunnel", in, out, opts...)
102
if err != nil {
103
return nil, err
104
}
105
return out, nil
106
}
107
108
func (c *portServiceClient) RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error) {
109
out := new(RetryAutoExposeResponse)
110
err := c.cc.Invoke(ctx, "/supervisor.PortService/RetryAutoExpose", in, out, opts...)
111
if err != nil {
112
return nil, err
113
}
114
return out, nil
115
}
116
117
// PortServiceServer is the server API for PortService service.
118
// All implementations must embed UnimplementedPortServiceServer
119
// for forward compatibility
120
type PortServiceServer interface {
121
// Tunnel notifies clients to install listeners on remote machines.
122
// After that such clients should call EstablishTunnel to forward incoming connections.
123
Tunnel(context.Context, *TunnelPortRequest) (*TunnelPortResponse, error)
124
// CloseTunnel notifies clients to remove listeners on remote machines.
125
CloseTunnel(context.Context, *CloseTunnelRequest) (*CloseTunnelResponse, error)
126
// EstablishTunnel actually establishes the tunnel for an incoming connection on a remote machine.
127
EstablishTunnel(PortService_EstablishTunnelServer) error
128
// AutoTunnel controls enablement of auto tunneling
129
AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error)
130
// RetryAutoExpose retries auto exposing the give port
131
RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error)
132
mustEmbedUnimplementedPortServiceServer()
133
}
134
135
// UnimplementedPortServiceServer must be embedded to have forward compatible implementations.
136
type UnimplementedPortServiceServer struct {
137
}
138
139
func (UnimplementedPortServiceServer) Tunnel(context.Context, *TunnelPortRequest) (*TunnelPortResponse, error) {
140
return nil, status.Errorf(codes.Unimplemented, "method Tunnel not implemented")
141
}
142
func (UnimplementedPortServiceServer) CloseTunnel(context.Context, *CloseTunnelRequest) (*CloseTunnelResponse, error) {
143
return nil, status.Errorf(codes.Unimplemented, "method CloseTunnel not implemented")
144
}
145
func (UnimplementedPortServiceServer) EstablishTunnel(PortService_EstablishTunnelServer) error {
146
return status.Errorf(codes.Unimplemented, "method EstablishTunnel not implemented")
147
}
148
func (UnimplementedPortServiceServer) AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error) {
149
return nil, status.Errorf(codes.Unimplemented, "method AutoTunnel not implemented")
150
}
151
func (UnimplementedPortServiceServer) RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error) {
152
return nil, status.Errorf(codes.Unimplemented, "method RetryAutoExpose not implemented")
153
}
154
func (UnimplementedPortServiceServer) mustEmbedUnimplementedPortServiceServer() {}
155
156
// UnsafePortServiceServer may be embedded to opt out of forward compatibility for this service.
157
// Use of this interface is not recommended, as added methods to PortServiceServer will
158
// result in compilation errors.
159
type UnsafePortServiceServer interface {
160
mustEmbedUnimplementedPortServiceServer()
161
}
162
163
func RegisterPortServiceServer(s grpc.ServiceRegistrar, srv PortServiceServer) {
164
s.RegisterService(&PortService_ServiceDesc, srv)
165
}
166
167
func _PortService_Tunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
168
in := new(TunnelPortRequest)
169
if err := dec(in); err != nil {
170
return nil, err
171
}
172
if interceptor == nil {
173
return srv.(PortServiceServer).Tunnel(ctx, in)
174
}
175
info := &grpc.UnaryServerInfo{
176
Server: srv,
177
FullMethod: "/supervisor.PortService/Tunnel",
178
}
179
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
180
return srv.(PortServiceServer).Tunnel(ctx, req.(*TunnelPortRequest))
181
}
182
return interceptor(ctx, in, info, handler)
183
}
184
185
func _PortService_CloseTunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
186
in := new(CloseTunnelRequest)
187
if err := dec(in); err != nil {
188
return nil, err
189
}
190
if interceptor == nil {
191
return srv.(PortServiceServer).CloseTunnel(ctx, in)
192
}
193
info := &grpc.UnaryServerInfo{
194
Server: srv,
195
FullMethod: "/supervisor.PortService/CloseTunnel",
196
}
197
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
198
return srv.(PortServiceServer).CloseTunnel(ctx, req.(*CloseTunnelRequest))
199
}
200
return interceptor(ctx, in, info, handler)
201
}
202
203
func _PortService_EstablishTunnel_Handler(srv interface{}, stream grpc.ServerStream) error {
204
return srv.(PortServiceServer).EstablishTunnel(&portServiceEstablishTunnelServer{stream})
205
}
206
207
type PortService_EstablishTunnelServer interface {
208
Send(*EstablishTunnelResponse) error
209
Recv() (*EstablishTunnelRequest, error)
210
grpc.ServerStream
211
}
212
213
type portServiceEstablishTunnelServer struct {
214
grpc.ServerStream
215
}
216
217
func (x *portServiceEstablishTunnelServer) Send(m *EstablishTunnelResponse) error {
218
return x.ServerStream.SendMsg(m)
219
}
220
221
func (x *portServiceEstablishTunnelServer) Recv() (*EstablishTunnelRequest, error) {
222
m := new(EstablishTunnelRequest)
223
if err := x.ServerStream.RecvMsg(m); err != nil {
224
return nil, err
225
}
226
return m, nil
227
}
228
229
func _PortService_AutoTunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
230
in := new(AutoTunnelRequest)
231
if err := dec(in); err != nil {
232
return nil, err
233
}
234
if interceptor == nil {
235
return srv.(PortServiceServer).AutoTunnel(ctx, in)
236
}
237
info := &grpc.UnaryServerInfo{
238
Server: srv,
239
FullMethod: "/supervisor.PortService/AutoTunnel",
240
}
241
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
242
return srv.(PortServiceServer).AutoTunnel(ctx, req.(*AutoTunnelRequest))
243
}
244
return interceptor(ctx, in, info, handler)
245
}
246
247
func _PortService_RetryAutoExpose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
248
in := new(RetryAutoExposeRequest)
249
if err := dec(in); err != nil {
250
return nil, err
251
}
252
if interceptor == nil {
253
return srv.(PortServiceServer).RetryAutoExpose(ctx, in)
254
}
255
info := &grpc.UnaryServerInfo{
256
Server: srv,
257
FullMethod: "/supervisor.PortService/RetryAutoExpose",
258
}
259
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
260
return srv.(PortServiceServer).RetryAutoExpose(ctx, req.(*RetryAutoExposeRequest))
261
}
262
return interceptor(ctx, in, info, handler)
263
}
264
265
// PortService_ServiceDesc is the grpc.ServiceDesc for PortService service.
266
// It's only intended for direct use with grpc.RegisterService,
267
// and not to be introspected or modified (even as a copy)
268
var PortService_ServiceDesc = grpc.ServiceDesc{
269
ServiceName: "supervisor.PortService",
270
HandlerType: (*PortServiceServer)(nil),
271
Methods: []grpc.MethodDesc{
272
{
273
MethodName: "Tunnel",
274
Handler: _PortService_Tunnel_Handler,
275
},
276
{
277
MethodName: "CloseTunnel",
278
Handler: _PortService_CloseTunnel_Handler,
279
},
280
{
281
MethodName: "AutoTunnel",
282
Handler: _PortService_AutoTunnel_Handler,
283
},
284
{
285
MethodName: "RetryAutoExpose",
286
Handler: _PortService_RetryAutoExpose_Handler,
287
},
288
},
289
Streams: []grpc.StreamDesc{
290
{
291
StreamName: "EstablishTunnel",
292
Handler: _PortService_EstablishTunnel_Handler,
293
ServerStreams: true,
294
ClientStreams: true,
295
},
296
},
297
Metadata: "port.proto",
298
}
299
300