@latticexyz/services 0.16.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,421 @@
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+ // versions:
3
+ // - protoc-gen-go-grpc v1.2.0
4
+ // - protoc v3.21.3
5
+ // source: proto/ecs-relay.proto
6
+
7
+ package ecs_relay
8
+
9
+ import (
10
+ context "context"
11
+ grpc "google.golang.org/grpc"
12
+ codes "google.golang.org/grpc/codes"
13
+ status "google.golang.org/grpc/status"
14
+ )
15
+
16
+ // This is a compile-time assertion to ensure that this generated file
17
+ // is compatible with the grpc package it is being compiled against.
18
+ // Requires gRPC-Go v1.32.0 or later.
19
+ const _ = grpc.SupportPackageIsVersion7
20
+
21
+ // ECSRelayServiceClient is the client API for ECSRelayService service.
22
+ //
23
+ // 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.
24
+ type ECSRelayServiceClient interface {
25
+ Authenticate(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error)
26
+ Revoke(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error)
27
+ Ping(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error)
28
+ CountAuthenticated(ctx context.Context, in *CountIdentitiesRequest, opts ...grpc.CallOption) (*CountIdentitiesResponse, error)
29
+ CountConnected(ctx context.Context, in *CountIdentitiesRequest, opts ...grpc.CallOption) (*CountIdentitiesResponse, error)
30
+ Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
31
+ Unsubscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
32
+ OpenStream(ctx context.Context, in *Identity, opts ...grpc.CallOption) (ECSRelayService_OpenStreamClient, error)
33
+ Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error)
34
+ }
35
+
36
+ type eCSRelayServiceClient struct {
37
+ cc grpc.ClientConnInterface
38
+ }
39
+
40
+ func NewECSRelayServiceClient(cc grpc.ClientConnInterface) ECSRelayServiceClient {
41
+ return &eCSRelayServiceClient{cc}
42
+ }
43
+
44
+ func (c *eCSRelayServiceClient) Authenticate(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error) {
45
+ out := new(Identity)
46
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Authenticate", in, out, opts...)
47
+ if err != nil {
48
+ return nil, err
49
+ }
50
+ return out, nil
51
+ }
52
+
53
+ func (c *eCSRelayServiceClient) Revoke(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error) {
54
+ out := new(Identity)
55
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Revoke", in, out, opts...)
56
+ if err != nil {
57
+ return nil, err
58
+ }
59
+ return out, nil
60
+ }
61
+
62
+ func (c *eCSRelayServiceClient) Ping(ctx context.Context, in *Identity, opts ...grpc.CallOption) (*Identity, error) {
63
+ out := new(Identity)
64
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Ping", in, out, opts...)
65
+ if err != nil {
66
+ return nil, err
67
+ }
68
+ return out, nil
69
+ }
70
+
71
+ func (c *eCSRelayServiceClient) CountAuthenticated(ctx context.Context, in *CountIdentitiesRequest, opts ...grpc.CallOption) (*CountIdentitiesResponse, error) {
72
+ out := new(CountIdentitiesResponse)
73
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/CountAuthenticated", in, out, opts...)
74
+ if err != nil {
75
+ return nil, err
76
+ }
77
+ return out, nil
78
+ }
79
+
80
+ func (c *eCSRelayServiceClient) CountConnected(ctx context.Context, in *CountIdentitiesRequest, opts ...grpc.CallOption) (*CountIdentitiesResponse, error) {
81
+ out := new(CountIdentitiesResponse)
82
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/CountConnected", in, out, opts...)
83
+ if err != nil {
84
+ return nil, err
85
+ }
86
+ return out, nil
87
+ }
88
+
89
+ func (c *eCSRelayServiceClient) Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
90
+ out := new(Subscription)
91
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Subscribe", in, out, opts...)
92
+ if err != nil {
93
+ return nil, err
94
+ }
95
+ return out, nil
96
+ }
97
+
98
+ func (c *eCSRelayServiceClient) Unsubscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
99
+ out := new(Subscription)
100
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Unsubscribe", in, out, opts...)
101
+ if err != nil {
102
+ return nil, err
103
+ }
104
+ return out, nil
105
+ }
106
+
107
+ func (c *eCSRelayServiceClient) OpenStream(ctx context.Context, in *Identity, opts ...grpc.CallOption) (ECSRelayService_OpenStreamClient, error) {
108
+ stream, err := c.cc.NewStream(ctx, &ECSRelayService_ServiceDesc.Streams[0], "/ecsrelay.ECSRelayService/OpenStream", opts...)
109
+ if err != nil {
110
+ return nil, err
111
+ }
112
+ x := &eCSRelayServiceOpenStreamClient{stream}
113
+ if err := x.ClientStream.SendMsg(in); err != nil {
114
+ return nil, err
115
+ }
116
+ if err := x.ClientStream.CloseSend(); err != nil {
117
+ return nil, err
118
+ }
119
+ return x, nil
120
+ }
121
+
122
+ type ECSRelayService_OpenStreamClient interface {
123
+ Recv() (*Message, error)
124
+ grpc.ClientStream
125
+ }
126
+
127
+ type eCSRelayServiceOpenStreamClient struct {
128
+ grpc.ClientStream
129
+ }
130
+
131
+ func (x *eCSRelayServiceOpenStreamClient) Recv() (*Message, error) {
132
+ m := new(Message)
133
+ if err := x.ClientStream.RecvMsg(m); err != nil {
134
+ return nil, err
135
+ }
136
+ return m, nil
137
+ }
138
+
139
+ func (c *eCSRelayServiceClient) Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) {
140
+ out := new(PushResponse)
141
+ err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Push", in, out, opts...)
142
+ if err != nil {
143
+ return nil, err
144
+ }
145
+ return out, nil
146
+ }
147
+
148
+ // ECSRelayServiceServer is the server API for ECSRelayService service.
149
+ // All implementations must embed UnimplementedECSRelayServiceServer
150
+ // for forward compatibility
151
+ type ECSRelayServiceServer interface {
152
+ Authenticate(context.Context, *Identity) (*Identity, error)
153
+ Revoke(context.Context, *Identity) (*Identity, error)
154
+ Ping(context.Context, *Identity) (*Identity, error)
155
+ CountAuthenticated(context.Context, *CountIdentitiesRequest) (*CountIdentitiesResponse, error)
156
+ CountConnected(context.Context, *CountIdentitiesRequest) (*CountIdentitiesResponse, error)
157
+ Subscribe(context.Context, *SubscriptionRequest) (*Subscription, error)
158
+ Unsubscribe(context.Context, *SubscriptionRequest) (*Subscription, error)
159
+ OpenStream(*Identity, ECSRelayService_OpenStreamServer) error
160
+ Push(context.Context, *PushRequest) (*PushResponse, error)
161
+ mustEmbedUnimplementedECSRelayServiceServer()
162
+ }
163
+
164
+ // UnimplementedECSRelayServiceServer must be embedded to have forward compatible implementations.
165
+ type UnimplementedECSRelayServiceServer struct {
166
+ }
167
+
168
+ func (UnimplementedECSRelayServiceServer) Authenticate(context.Context, *Identity) (*Identity, error) {
169
+ return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
170
+ }
171
+ func (UnimplementedECSRelayServiceServer) Revoke(context.Context, *Identity) (*Identity, error) {
172
+ return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
173
+ }
174
+ func (UnimplementedECSRelayServiceServer) Ping(context.Context, *Identity) (*Identity, error) {
175
+ return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
176
+ }
177
+ func (UnimplementedECSRelayServiceServer) CountAuthenticated(context.Context, *CountIdentitiesRequest) (*CountIdentitiesResponse, error) {
178
+ return nil, status.Errorf(codes.Unimplemented, "method CountAuthenticated not implemented")
179
+ }
180
+ func (UnimplementedECSRelayServiceServer) CountConnected(context.Context, *CountIdentitiesRequest) (*CountIdentitiesResponse, error) {
181
+ return nil, status.Errorf(codes.Unimplemented, "method CountConnected not implemented")
182
+ }
183
+ func (UnimplementedECSRelayServiceServer) Subscribe(context.Context, *SubscriptionRequest) (*Subscription, error) {
184
+ return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
185
+ }
186
+ func (UnimplementedECSRelayServiceServer) Unsubscribe(context.Context, *SubscriptionRequest) (*Subscription, error) {
187
+ return nil, status.Errorf(codes.Unimplemented, "method Unsubscribe not implemented")
188
+ }
189
+ func (UnimplementedECSRelayServiceServer) OpenStream(*Identity, ECSRelayService_OpenStreamServer) error {
190
+ return status.Errorf(codes.Unimplemented, "method OpenStream not implemented")
191
+ }
192
+ func (UnimplementedECSRelayServiceServer) Push(context.Context, *PushRequest) (*PushResponse, error) {
193
+ return nil, status.Errorf(codes.Unimplemented, "method Push not implemented")
194
+ }
195
+ func (UnimplementedECSRelayServiceServer) mustEmbedUnimplementedECSRelayServiceServer() {}
196
+
197
+ // UnsafeECSRelayServiceServer may be embedded to opt out of forward compatibility for this service.
198
+ // Use of this interface is not recommended, as added methods to ECSRelayServiceServer will
199
+ // result in compilation errors.
200
+ type UnsafeECSRelayServiceServer interface {
201
+ mustEmbedUnimplementedECSRelayServiceServer()
202
+ }
203
+
204
+ func RegisterECSRelayServiceServer(s grpc.ServiceRegistrar, srv ECSRelayServiceServer) {
205
+ s.RegisterService(&ECSRelayService_ServiceDesc, srv)
206
+ }
207
+
208
+ func _ECSRelayService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
209
+ in := new(Identity)
210
+ if err := dec(in); err != nil {
211
+ return nil, err
212
+ }
213
+ if interceptor == nil {
214
+ return srv.(ECSRelayServiceServer).Authenticate(ctx, in)
215
+ }
216
+ info := &grpc.UnaryServerInfo{
217
+ Server: srv,
218
+ FullMethod: "/ecsrelay.ECSRelayService/Authenticate",
219
+ }
220
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
221
+ return srv.(ECSRelayServiceServer).Authenticate(ctx, req.(*Identity))
222
+ }
223
+ return interceptor(ctx, in, info, handler)
224
+ }
225
+
226
+ func _ECSRelayService_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
227
+ in := new(Identity)
228
+ if err := dec(in); err != nil {
229
+ return nil, err
230
+ }
231
+ if interceptor == nil {
232
+ return srv.(ECSRelayServiceServer).Revoke(ctx, in)
233
+ }
234
+ info := &grpc.UnaryServerInfo{
235
+ Server: srv,
236
+ FullMethod: "/ecsrelay.ECSRelayService/Revoke",
237
+ }
238
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
239
+ return srv.(ECSRelayServiceServer).Revoke(ctx, req.(*Identity))
240
+ }
241
+ return interceptor(ctx, in, info, handler)
242
+ }
243
+
244
+ func _ECSRelayService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
245
+ in := new(Identity)
246
+ if err := dec(in); err != nil {
247
+ return nil, err
248
+ }
249
+ if interceptor == nil {
250
+ return srv.(ECSRelayServiceServer).Ping(ctx, in)
251
+ }
252
+ info := &grpc.UnaryServerInfo{
253
+ Server: srv,
254
+ FullMethod: "/ecsrelay.ECSRelayService/Ping",
255
+ }
256
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
257
+ return srv.(ECSRelayServiceServer).Ping(ctx, req.(*Identity))
258
+ }
259
+ return interceptor(ctx, in, info, handler)
260
+ }
261
+
262
+ func _ECSRelayService_CountAuthenticated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
263
+ in := new(CountIdentitiesRequest)
264
+ if err := dec(in); err != nil {
265
+ return nil, err
266
+ }
267
+ if interceptor == nil {
268
+ return srv.(ECSRelayServiceServer).CountAuthenticated(ctx, in)
269
+ }
270
+ info := &grpc.UnaryServerInfo{
271
+ Server: srv,
272
+ FullMethod: "/ecsrelay.ECSRelayService/CountAuthenticated",
273
+ }
274
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
275
+ return srv.(ECSRelayServiceServer).CountAuthenticated(ctx, req.(*CountIdentitiesRequest))
276
+ }
277
+ return interceptor(ctx, in, info, handler)
278
+ }
279
+
280
+ func _ECSRelayService_CountConnected_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
281
+ in := new(CountIdentitiesRequest)
282
+ if err := dec(in); err != nil {
283
+ return nil, err
284
+ }
285
+ if interceptor == nil {
286
+ return srv.(ECSRelayServiceServer).CountConnected(ctx, in)
287
+ }
288
+ info := &grpc.UnaryServerInfo{
289
+ Server: srv,
290
+ FullMethod: "/ecsrelay.ECSRelayService/CountConnected",
291
+ }
292
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
293
+ return srv.(ECSRelayServiceServer).CountConnected(ctx, req.(*CountIdentitiesRequest))
294
+ }
295
+ return interceptor(ctx, in, info, handler)
296
+ }
297
+
298
+ func _ECSRelayService_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
299
+ in := new(SubscriptionRequest)
300
+ if err := dec(in); err != nil {
301
+ return nil, err
302
+ }
303
+ if interceptor == nil {
304
+ return srv.(ECSRelayServiceServer).Subscribe(ctx, in)
305
+ }
306
+ info := &grpc.UnaryServerInfo{
307
+ Server: srv,
308
+ FullMethod: "/ecsrelay.ECSRelayService/Subscribe",
309
+ }
310
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
311
+ return srv.(ECSRelayServiceServer).Subscribe(ctx, req.(*SubscriptionRequest))
312
+ }
313
+ return interceptor(ctx, in, info, handler)
314
+ }
315
+
316
+ func _ECSRelayService_Unsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
317
+ in := new(SubscriptionRequest)
318
+ if err := dec(in); err != nil {
319
+ return nil, err
320
+ }
321
+ if interceptor == nil {
322
+ return srv.(ECSRelayServiceServer).Unsubscribe(ctx, in)
323
+ }
324
+ info := &grpc.UnaryServerInfo{
325
+ Server: srv,
326
+ FullMethod: "/ecsrelay.ECSRelayService/Unsubscribe",
327
+ }
328
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
329
+ return srv.(ECSRelayServiceServer).Unsubscribe(ctx, req.(*SubscriptionRequest))
330
+ }
331
+ return interceptor(ctx, in, info, handler)
332
+ }
333
+
334
+ func _ECSRelayService_OpenStream_Handler(srv interface{}, stream grpc.ServerStream) error {
335
+ m := new(Identity)
336
+ if err := stream.RecvMsg(m); err != nil {
337
+ return err
338
+ }
339
+ return srv.(ECSRelayServiceServer).OpenStream(m, &eCSRelayServiceOpenStreamServer{stream})
340
+ }
341
+
342
+ type ECSRelayService_OpenStreamServer interface {
343
+ Send(*Message) error
344
+ grpc.ServerStream
345
+ }
346
+
347
+ type eCSRelayServiceOpenStreamServer struct {
348
+ grpc.ServerStream
349
+ }
350
+
351
+ func (x *eCSRelayServiceOpenStreamServer) Send(m *Message) error {
352
+ return x.ServerStream.SendMsg(m)
353
+ }
354
+
355
+ func _ECSRelayService_Push_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
356
+ in := new(PushRequest)
357
+ if err := dec(in); err != nil {
358
+ return nil, err
359
+ }
360
+ if interceptor == nil {
361
+ return srv.(ECSRelayServiceServer).Push(ctx, in)
362
+ }
363
+ info := &grpc.UnaryServerInfo{
364
+ Server: srv,
365
+ FullMethod: "/ecsrelay.ECSRelayService/Push",
366
+ }
367
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
368
+ return srv.(ECSRelayServiceServer).Push(ctx, req.(*PushRequest))
369
+ }
370
+ return interceptor(ctx, in, info, handler)
371
+ }
372
+
373
+ // ECSRelayService_ServiceDesc is the grpc.ServiceDesc for ECSRelayService service.
374
+ // It's only intended for direct use with grpc.RegisterService,
375
+ // and not to be introspected or modified (even as a copy)
376
+ var ECSRelayService_ServiceDesc = grpc.ServiceDesc{
377
+ ServiceName: "ecsrelay.ECSRelayService",
378
+ HandlerType: (*ECSRelayServiceServer)(nil),
379
+ Methods: []grpc.MethodDesc{
380
+ {
381
+ MethodName: "Authenticate",
382
+ Handler: _ECSRelayService_Authenticate_Handler,
383
+ },
384
+ {
385
+ MethodName: "Revoke",
386
+ Handler: _ECSRelayService_Revoke_Handler,
387
+ },
388
+ {
389
+ MethodName: "Ping",
390
+ Handler: _ECSRelayService_Ping_Handler,
391
+ },
392
+ {
393
+ MethodName: "CountAuthenticated",
394
+ Handler: _ECSRelayService_CountAuthenticated_Handler,
395
+ },
396
+ {
397
+ MethodName: "CountConnected",
398
+ Handler: _ECSRelayService_CountConnected_Handler,
399
+ },
400
+ {
401
+ MethodName: "Subscribe",
402
+ Handler: _ECSRelayService_Subscribe_Handler,
403
+ },
404
+ {
405
+ MethodName: "Unsubscribe",
406
+ Handler: _ECSRelayService_Unsubscribe_Handler,
407
+ },
408
+ {
409
+ MethodName: "Push",
410
+ Handler: _ECSRelayService_Push_Handler,
411
+ },
412
+ },
413
+ Streams: []grpc.StreamDesc{
414
+ {
415
+ StreamName: "OpenStream",
416
+ Handler: _ECSRelayService_OpenStream_Handler,
417
+ ServerStreams: true,
418
+ },
419
+ },
420
+ Metadata: "proto/ecs-relay.proto",
421
+ }