Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/supervisor-api/go/notification_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: notification.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
// NotificationServiceClient is the client API for NotificationService 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 NotificationServiceClient interface {
29
// Prompts the user and asks for a decision. Typically called by some external
30
// process. If the list of actions is empty this service returns immediately,
31
// otherwise it blocks until the user has made their choice.
32
Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
33
// Subscribe to notifications. Typically called by the IDE.
34
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (NotificationService_SubscribeClient, error)
35
// Report a user's choice as a response to a notification. Typically called by
36
// the IDE.
37
Respond(ctx context.Context, in *RespondRequest, opts ...grpc.CallOption) (*RespondResponse, error)
38
// Called by the IDE to inform supervisor about which is the latest client
39
// actively used by the user. We consider active the last IDE with focus.
40
// Only 1 stream is kept open at any given time. A new subscription
41
// overrides the previous one, causing the stream to close.
42
// Supervisor will respond with a stream to which the IDE will listen
43
// waiting to receive actions to run, for example: `open` or `preview`
44
SubscribeActive(ctx context.Context, in *SubscribeActiveRequest, opts ...grpc.CallOption) (NotificationService_SubscribeActiveClient, error)
45
// Used by gp-cli to ask supervisor to request the active client
46
// to run a given command (eg. open or preview)
47
NotifyActive(ctx context.Context, in *NotifyActiveRequest, opts ...grpc.CallOption) (*NotifyActiveResponse, error)
48
// Used by the IDE to inform supervisor about the result (eg. success or
49
// failure) of the action (eg. open or preview) requested via NotifyActive
50
NotifyActiveRespond(ctx context.Context, in *NotifyActiveRespondRequest, opts ...grpc.CallOption) (*NotifyActiveRespondResponse, error)
51
}
52
53
type notificationServiceClient struct {
54
cc grpc.ClientConnInterface
55
}
56
57
func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServiceClient {
58
return &notificationServiceClient{cc}
59
}
60
61
func (c *notificationServiceClient) Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
62
out := new(NotifyResponse)
63
err := c.cc.Invoke(ctx, "/supervisor.NotificationService/Notify", in, out, opts...)
64
if err != nil {
65
return nil, err
66
}
67
return out, nil
68
}
69
70
func (c *notificationServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (NotificationService_SubscribeClient, error) {
71
stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/supervisor.NotificationService/Subscribe", opts...)
72
if err != nil {
73
return nil, err
74
}
75
x := &notificationServiceSubscribeClient{stream}
76
if err := x.ClientStream.SendMsg(in); err != nil {
77
return nil, err
78
}
79
if err := x.ClientStream.CloseSend(); err != nil {
80
return nil, err
81
}
82
return x, nil
83
}
84
85
type NotificationService_SubscribeClient interface {
86
Recv() (*SubscribeResponse, error)
87
grpc.ClientStream
88
}
89
90
type notificationServiceSubscribeClient struct {
91
grpc.ClientStream
92
}
93
94
func (x *notificationServiceSubscribeClient) Recv() (*SubscribeResponse, error) {
95
m := new(SubscribeResponse)
96
if err := x.ClientStream.RecvMsg(m); err != nil {
97
return nil, err
98
}
99
return m, nil
100
}
101
102
func (c *notificationServiceClient) Respond(ctx context.Context, in *RespondRequest, opts ...grpc.CallOption) (*RespondResponse, error) {
103
out := new(RespondResponse)
104
err := c.cc.Invoke(ctx, "/supervisor.NotificationService/Respond", in, out, opts...)
105
if err != nil {
106
return nil, err
107
}
108
return out, nil
109
}
110
111
func (c *notificationServiceClient) SubscribeActive(ctx context.Context, in *SubscribeActiveRequest, opts ...grpc.CallOption) (NotificationService_SubscribeActiveClient, error) {
112
stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], "/supervisor.NotificationService/SubscribeActive", opts...)
113
if err != nil {
114
return nil, err
115
}
116
x := &notificationServiceSubscribeActiveClient{stream}
117
if err := x.ClientStream.SendMsg(in); err != nil {
118
return nil, err
119
}
120
if err := x.ClientStream.CloseSend(); err != nil {
121
return nil, err
122
}
123
return x, nil
124
}
125
126
type NotificationService_SubscribeActiveClient interface {
127
Recv() (*SubscribeActiveResponse, error)
128
grpc.ClientStream
129
}
130
131
type notificationServiceSubscribeActiveClient struct {
132
grpc.ClientStream
133
}
134
135
func (x *notificationServiceSubscribeActiveClient) Recv() (*SubscribeActiveResponse, error) {
136
m := new(SubscribeActiveResponse)
137
if err := x.ClientStream.RecvMsg(m); err != nil {
138
return nil, err
139
}
140
return m, nil
141
}
142
143
func (c *notificationServiceClient) NotifyActive(ctx context.Context, in *NotifyActiveRequest, opts ...grpc.CallOption) (*NotifyActiveResponse, error) {
144
out := new(NotifyActiveResponse)
145
err := c.cc.Invoke(ctx, "/supervisor.NotificationService/NotifyActive", in, out, opts...)
146
if err != nil {
147
return nil, err
148
}
149
return out, nil
150
}
151
152
func (c *notificationServiceClient) NotifyActiveRespond(ctx context.Context, in *NotifyActiveRespondRequest, opts ...grpc.CallOption) (*NotifyActiveRespondResponse, error) {
153
out := new(NotifyActiveRespondResponse)
154
err := c.cc.Invoke(ctx, "/supervisor.NotificationService/NotifyActiveRespond", in, out, opts...)
155
if err != nil {
156
return nil, err
157
}
158
return out, nil
159
}
160
161
// NotificationServiceServer is the server API for NotificationService service.
162
// All implementations must embed UnimplementedNotificationServiceServer
163
// for forward compatibility
164
type NotificationServiceServer interface {
165
// Prompts the user and asks for a decision. Typically called by some external
166
// process. If the list of actions is empty this service returns immediately,
167
// otherwise it blocks until the user has made their choice.
168
Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
169
// Subscribe to notifications. Typically called by the IDE.
170
Subscribe(*SubscribeRequest, NotificationService_SubscribeServer) error
171
// Report a user's choice as a response to a notification. Typically called by
172
// the IDE.
173
Respond(context.Context, *RespondRequest) (*RespondResponse, error)
174
// Called by the IDE to inform supervisor about which is the latest client
175
// actively used by the user. We consider active the last IDE with focus.
176
// Only 1 stream is kept open at any given time. A new subscription
177
// overrides the previous one, causing the stream to close.
178
// Supervisor will respond with a stream to which the IDE will listen
179
// waiting to receive actions to run, for example: `open` or `preview`
180
SubscribeActive(*SubscribeActiveRequest, NotificationService_SubscribeActiveServer) error
181
// Used by gp-cli to ask supervisor to request the active client
182
// to run a given command (eg. open or preview)
183
NotifyActive(context.Context, *NotifyActiveRequest) (*NotifyActiveResponse, error)
184
// Used by the IDE to inform supervisor about the result (eg. success or
185
// failure) of the action (eg. open or preview) requested via NotifyActive
186
NotifyActiveRespond(context.Context, *NotifyActiveRespondRequest) (*NotifyActiveRespondResponse, error)
187
mustEmbedUnimplementedNotificationServiceServer()
188
}
189
190
// UnimplementedNotificationServiceServer must be embedded to have forward compatible implementations.
191
type UnimplementedNotificationServiceServer struct {
192
}
193
194
func (UnimplementedNotificationServiceServer) Notify(context.Context, *NotifyRequest) (*NotifyResponse, error) {
195
return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")
196
}
197
func (UnimplementedNotificationServiceServer) Subscribe(*SubscribeRequest, NotificationService_SubscribeServer) error {
198
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
199
}
200
func (UnimplementedNotificationServiceServer) Respond(context.Context, *RespondRequest) (*RespondResponse, error) {
201
return nil, status.Errorf(codes.Unimplemented, "method Respond not implemented")
202
}
203
func (UnimplementedNotificationServiceServer) SubscribeActive(*SubscribeActiveRequest, NotificationService_SubscribeActiveServer) error {
204
return status.Errorf(codes.Unimplemented, "method SubscribeActive not implemented")
205
}
206
func (UnimplementedNotificationServiceServer) NotifyActive(context.Context, *NotifyActiveRequest) (*NotifyActiveResponse, error) {
207
return nil, status.Errorf(codes.Unimplemented, "method NotifyActive not implemented")
208
}
209
func (UnimplementedNotificationServiceServer) NotifyActiveRespond(context.Context, *NotifyActiveRespondRequest) (*NotifyActiveRespondResponse, error) {
210
return nil, status.Errorf(codes.Unimplemented, "method NotifyActiveRespond not implemented")
211
}
212
func (UnimplementedNotificationServiceServer) mustEmbedUnimplementedNotificationServiceServer() {}
213
214
// UnsafeNotificationServiceServer may be embedded to opt out of forward compatibility for this service.
215
// Use of this interface is not recommended, as added methods to NotificationServiceServer will
216
// result in compilation errors.
217
type UnsafeNotificationServiceServer interface {
218
mustEmbedUnimplementedNotificationServiceServer()
219
}
220
221
func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv NotificationServiceServer) {
222
s.RegisterService(&NotificationService_ServiceDesc, srv)
223
}
224
225
func _NotificationService_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
226
in := new(NotifyRequest)
227
if err := dec(in); err != nil {
228
return nil, err
229
}
230
if interceptor == nil {
231
return srv.(NotificationServiceServer).Notify(ctx, in)
232
}
233
info := &grpc.UnaryServerInfo{
234
Server: srv,
235
FullMethod: "/supervisor.NotificationService/Notify",
236
}
237
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
238
return srv.(NotificationServiceServer).Notify(ctx, req.(*NotifyRequest))
239
}
240
return interceptor(ctx, in, info, handler)
241
}
242
243
func _NotificationService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
244
m := new(SubscribeRequest)
245
if err := stream.RecvMsg(m); err != nil {
246
return err
247
}
248
return srv.(NotificationServiceServer).Subscribe(m, &notificationServiceSubscribeServer{stream})
249
}
250
251
type NotificationService_SubscribeServer interface {
252
Send(*SubscribeResponse) error
253
grpc.ServerStream
254
}
255
256
type notificationServiceSubscribeServer struct {
257
grpc.ServerStream
258
}
259
260
func (x *notificationServiceSubscribeServer) Send(m *SubscribeResponse) error {
261
return x.ServerStream.SendMsg(m)
262
}
263
264
func _NotificationService_Respond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
265
in := new(RespondRequest)
266
if err := dec(in); err != nil {
267
return nil, err
268
}
269
if interceptor == nil {
270
return srv.(NotificationServiceServer).Respond(ctx, in)
271
}
272
info := &grpc.UnaryServerInfo{
273
Server: srv,
274
FullMethod: "/supervisor.NotificationService/Respond",
275
}
276
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
277
return srv.(NotificationServiceServer).Respond(ctx, req.(*RespondRequest))
278
}
279
return interceptor(ctx, in, info, handler)
280
}
281
282
func _NotificationService_SubscribeActive_Handler(srv interface{}, stream grpc.ServerStream) error {
283
m := new(SubscribeActiveRequest)
284
if err := stream.RecvMsg(m); err != nil {
285
return err
286
}
287
return srv.(NotificationServiceServer).SubscribeActive(m, &notificationServiceSubscribeActiveServer{stream})
288
}
289
290
type NotificationService_SubscribeActiveServer interface {
291
Send(*SubscribeActiveResponse) error
292
grpc.ServerStream
293
}
294
295
type notificationServiceSubscribeActiveServer struct {
296
grpc.ServerStream
297
}
298
299
func (x *notificationServiceSubscribeActiveServer) Send(m *SubscribeActiveResponse) error {
300
return x.ServerStream.SendMsg(m)
301
}
302
303
func _NotificationService_NotifyActive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
304
in := new(NotifyActiveRequest)
305
if err := dec(in); err != nil {
306
return nil, err
307
}
308
if interceptor == nil {
309
return srv.(NotificationServiceServer).NotifyActive(ctx, in)
310
}
311
info := &grpc.UnaryServerInfo{
312
Server: srv,
313
FullMethod: "/supervisor.NotificationService/NotifyActive",
314
}
315
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
316
return srv.(NotificationServiceServer).NotifyActive(ctx, req.(*NotifyActiveRequest))
317
}
318
return interceptor(ctx, in, info, handler)
319
}
320
321
func _NotificationService_NotifyActiveRespond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
322
in := new(NotifyActiveRespondRequest)
323
if err := dec(in); err != nil {
324
return nil, err
325
}
326
if interceptor == nil {
327
return srv.(NotificationServiceServer).NotifyActiveRespond(ctx, in)
328
}
329
info := &grpc.UnaryServerInfo{
330
Server: srv,
331
FullMethod: "/supervisor.NotificationService/NotifyActiveRespond",
332
}
333
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
334
return srv.(NotificationServiceServer).NotifyActiveRespond(ctx, req.(*NotifyActiveRespondRequest))
335
}
336
return interceptor(ctx, in, info, handler)
337
}
338
339
// NotificationService_ServiceDesc is the grpc.ServiceDesc for NotificationService service.
340
// It's only intended for direct use with grpc.RegisterService,
341
// and not to be introspected or modified (even as a copy)
342
var NotificationService_ServiceDesc = grpc.ServiceDesc{
343
ServiceName: "supervisor.NotificationService",
344
HandlerType: (*NotificationServiceServer)(nil),
345
Methods: []grpc.MethodDesc{
346
{
347
MethodName: "Notify",
348
Handler: _NotificationService_Notify_Handler,
349
},
350
{
351
MethodName: "Respond",
352
Handler: _NotificationService_Respond_Handler,
353
},
354
{
355
MethodName: "NotifyActive",
356
Handler: _NotificationService_NotifyActive_Handler,
357
},
358
{
359
MethodName: "NotifyActiveRespond",
360
Handler: _NotificationService_NotifyActiveRespond_Handler,
361
},
362
},
363
Streams: []grpc.StreamDesc{
364
{
365
StreamName: "Subscribe",
366
Handler: _NotificationService_Subscribe_Handler,
367
ServerStreams: true,
368
},
369
{
370
StreamName: "SubscribeActive",
371
Handler: _NotificationService_SubscribeActive_Handler,
372
ServerStreams: true,
373
},
374
},
375
Metadata: "notification.proto",
376
}
377
378