Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / gbp / gbp_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package gbp
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "git.fd.io/govpp.git/api"
11         vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
12 )
13
14 // RPCService defines RPC service gbp.
15 type RPCService interface {
16         GbpBridgeDomainAdd(ctx context.Context, in *GbpBridgeDomainAdd) (*GbpBridgeDomainAddReply, error)
17         GbpBridgeDomainDel(ctx context.Context, in *GbpBridgeDomainDel) (*GbpBridgeDomainDelReply, error)
18         GbpBridgeDomainDump(ctx context.Context, in *GbpBridgeDomainDump) (RPCService_GbpBridgeDomainDumpClient, error)
19         GbpContractAddDel(ctx context.Context, in *GbpContractAddDel) (*GbpContractAddDelReply, error)
20         GbpContractDump(ctx context.Context, in *GbpContractDump) (RPCService_GbpContractDumpClient, error)
21         GbpEndpointAdd(ctx context.Context, in *GbpEndpointAdd) (*GbpEndpointAddReply, error)
22         GbpEndpointDel(ctx context.Context, in *GbpEndpointDel) (*GbpEndpointDelReply, error)
23         GbpEndpointDump(ctx context.Context, in *GbpEndpointDump) (RPCService_GbpEndpointDumpClient, error)
24         GbpEndpointGroupAdd(ctx context.Context, in *GbpEndpointGroupAdd) (*GbpEndpointGroupAddReply, error)
25         GbpEndpointGroupDel(ctx context.Context, in *GbpEndpointGroupDel) (*GbpEndpointGroupDelReply, error)
26         GbpEndpointGroupDump(ctx context.Context, in *GbpEndpointGroupDump) (RPCService_GbpEndpointGroupDumpClient, error)
27         GbpExtItfAddDel(ctx context.Context, in *GbpExtItfAddDel) (*GbpExtItfAddDelReply, error)
28         GbpExtItfDump(ctx context.Context, in *GbpExtItfDump) (RPCService_GbpExtItfDumpClient, error)
29         GbpRecircAddDel(ctx context.Context, in *GbpRecircAddDel) (*GbpRecircAddDelReply, error)
30         GbpRecircDump(ctx context.Context, in *GbpRecircDump) (RPCService_GbpRecircDumpClient, error)
31         GbpRouteDomainAdd(ctx context.Context, in *GbpRouteDomainAdd) (*GbpRouteDomainAddReply, error)
32         GbpRouteDomainDel(ctx context.Context, in *GbpRouteDomainDel) (*GbpRouteDomainDelReply, error)
33         GbpRouteDomainDump(ctx context.Context, in *GbpRouteDomainDump) (RPCService_GbpRouteDomainDumpClient, error)
34         GbpSubnetAddDel(ctx context.Context, in *GbpSubnetAddDel) (*GbpSubnetAddDelReply, error)
35         GbpSubnetDump(ctx context.Context, in *GbpSubnetDump) (RPCService_GbpSubnetDumpClient, error)
36         GbpVxlanTunnelAdd(ctx context.Context, in *GbpVxlanTunnelAdd) (*GbpVxlanTunnelAddReply, error)
37         GbpVxlanTunnelDel(ctx context.Context, in *GbpVxlanTunnelDel) (*GbpVxlanTunnelDelReply, error)
38         GbpVxlanTunnelDump(ctx context.Context, in *GbpVxlanTunnelDump) (RPCService_GbpVxlanTunnelDumpClient, error)
39 }
40
41 type serviceClient struct {
42         conn api.Connection
43 }
44
45 func NewServiceClient(conn api.Connection) RPCService {
46         return &serviceClient{conn}
47 }
48
49 func (c *serviceClient) GbpBridgeDomainAdd(ctx context.Context, in *GbpBridgeDomainAdd) (*GbpBridgeDomainAddReply, error) {
50         out := new(GbpBridgeDomainAddReply)
51         err := c.conn.Invoke(ctx, in, out)
52         if err != nil {
53                 return nil, err
54         }
55         return out, api.RetvalToVPPApiError(out.Retval)
56 }
57
58 func (c *serviceClient) GbpBridgeDomainDel(ctx context.Context, in *GbpBridgeDomainDel) (*GbpBridgeDomainDelReply, error) {
59         out := new(GbpBridgeDomainDelReply)
60         err := c.conn.Invoke(ctx, in, out)
61         if err != nil {
62                 return nil, err
63         }
64         return out, api.RetvalToVPPApiError(out.Retval)
65 }
66
67 func (c *serviceClient) GbpBridgeDomainDump(ctx context.Context, in *GbpBridgeDomainDump) (RPCService_GbpBridgeDomainDumpClient, error) {
68         stream, err := c.conn.NewStream(ctx)
69         if err != nil {
70                 return nil, err
71         }
72         x := &serviceClient_GbpBridgeDomainDumpClient{stream}
73         if err := x.Stream.SendMsg(in); err != nil {
74                 return nil, err
75         }
76         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
77                 return nil, err
78         }
79         return x, nil
80 }
81
82 type RPCService_GbpBridgeDomainDumpClient interface {
83         Recv() (*GbpBridgeDomainDetails, error)
84         api.Stream
85 }
86
87 type serviceClient_GbpBridgeDomainDumpClient struct {
88         api.Stream
89 }
90
91 func (c *serviceClient_GbpBridgeDomainDumpClient) Recv() (*GbpBridgeDomainDetails, error) {
92         msg, err := c.Stream.RecvMsg()
93         if err != nil {
94                 return nil, err
95         }
96         switch m := msg.(type) {
97         case *GbpBridgeDomainDetails:
98                 return m, nil
99         case *vpe.ControlPingReply:
100                 err = c.Stream.Close()
101                 if err != nil {
102                         return nil, err
103                 }
104                 return nil, io.EOF
105         default:
106                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
107         }
108 }
109
110 func (c *serviceClient) GbpContractAddDel(ctx context.Context, in *GbpContractAddDel) (*GbpContractAddDelReply, error) {
111         out := new(GbpContractAddDelReply)
112         err := c.conn.Invoke(ctx, in, out)
113         if err != nil {
114                 return nil, err
115         }
116         return out, api.RetvalToVPPApiError(out.Retval)
117 }
118
119 func (c *serviceClient) GbpContractDump(ctx context.Context, in *GbpContractDump) (RPCService_GbpContractDumpClient, error) {
120         stream, err := c.conn.NewStream(ctx)
121         if err != nil {
122                 return nil, err
123         }
124         x := &serviceClient_GbpContractDumpClient{stream}
125         if err := x.Stream.SendMsg(in); err != nil {
126                 return nil, err
127         }
128         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
129                 return nil, err
130         }
131         return x, nil
132 }
133
134 type RPCService_GbpContractDumpClient interface {
135         Recv() (*GbpContractDetails, error)
136         api.Stream
137 }
138
139 type serviceClient_GbpContractDumpClient struct {
140         api.Stream
141 }
142
143 func (c *serviceClient_GbpContractDumpClient) Recv() (*GbpContractDetails, error) {
144         msg, err := c.Stream.RecvMsg()
145         if err != nil {
146                 return nil, err
147         }
148         switch m := msg.(type) {
149         case *GbpContractDetails:
150                 return m, nil
151         case *vpe.ControlPingReply:
152                 err = c.Stream.Close()
153                 if err != nil {
154                         return nil, err
155                 }
156                 return nil, io.EOF
157         default:
158                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
159         }
160 }
161
162 func (c *serviceClient) GbpEndpointAdd(ctx context.Context, in *GbpEndpointAdd) (*GbpEndpointAddReply, error) {
163         out := new(GbpEndpointAddReply)
164         err := c.conn.Invoke(ctx, in, out)
165         if err != nil {
166                 return nil, err
167         }
168         return out, api.RetvalToVPPApiError(out.Retval)
169 }
170
171 func (c *serviceClient) GbpEndpointDel(ctx context.Context, in *GbpEndpointDel) (*GbpEndpointDelReply, error) {
172         out := new(GbpEndpointDelReply)
173         err := c.conn.Invoke(ctx, in, out)
174         if err != nil {
175                 return nil, err
176         }
177         return out, api.RetvalToVPPApiError(out.Retval)
178 }
179
180 func (c *serviceClient) GbpEndpointDump(ctx context.Context, in *GbpEndpointDump) (RPCService_GbpEndpointDumpClient, error) {
181         stream, err := c.conn.NewStream(ctx)
182         if err != nil {
183                 return nil, err
184         }
185         x := &serviceClient_GbpEndpointDumpClient{stream}
186         if err := x.Stream.SendMsg(in); err != nil {
187                 return nil, err
188         }
189         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
190                 return nil, err
191         }
192         return x, nil
193 }
194
195 type RPCService_GbpEndpointDumpClient interface {
196         Recv() (*GbpEndpointDetails, error)
197         api.Stream
198 }
199
200 type serviceClient_GbpEndpointDumpClient struct {
201         api.Stream
202 }
203
204 func (c *serviceClient_GbpEndpointDumpClient) Recv() (*GbpEndpointDetails, error) {
205         msg, err := c.Stream.RecvMsg()
206         if err != nil {
207                 return nil, err
208         }
209         switch m := msg.(type) {
210         case *GbpEndpointDetails:
211                 return m, nil
212         case *vpe.ControlPingReply:
213                 err = c.Stream.Close()
214                 if err != nil {
215                         return nil, err
216                 }
217                 return nil, io.EOF
218         default:
219                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
220         }
221 }
222
223 func (c *serviceClient) GbpEndpointGroupAdd(ctx context.Context, in *GbpEndpointGroupAdd) (*GbpEndpointGroupAddReply, error) {
224         out := new(GbpEndpointGroupAddReply)
225         err := c.conn.Invoke(ctx, in, out)
226         if err != nil {
227                 return nil, err
228         }
229         return out, api.RetvalToVPPApiError(out.Retval)
230 }
231
232 func (c *serviceClient) GbpEndpointGroupDel(ctx context.Context, in *GbpEndpointGroupDel) (*GbpEndpointGroupDelReply, error) {
233         out := new(GbpEndpointGroupDelReply)
234         err := c.conn.Invoke(ctx, in, out)
235         if err != nil {
236                 return nil, err
237         }
238         return out, api.RetvalToVPPApiError(out.Retval)
239 }
240
241 func (c *serviceClient) GbpEndpointGroupDump(ctx context.Context, in *GbpEndpointGroupDump) (RPCService_GbpEndpointGroupDumpClient, error) {
242         stream, err := c.conn.NewStream(ctx)
243         if err != nil {
244                 return nil, err
245         }
246         x := &serviceClient_GbpEndpointGroupDumpClient{stream}
247         if err := x.Stream.SendMsg(in); err != nil {
248                 return nil, err
249         }
250         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
251                 return nil, err
252         }
253         return x, nil
254 }
255
256 type RPCService_GbpEndpointGroupDumpClient interface {
257         Recv() (*GbpEndpointGroupDetails, error)
258         api.Stream
259 }
260
261 type serviceClient_GbpEndpointGroupDumpClient struct {
262         api.Stream
263 }
264
265 func (c *serviceClient_GbpEndpointGroupDumpClient) Recv() (*GbpEndpointGroupDetails, error) {
266         msg, err := c.Stream.RecvMsg()
267         if err != nil {
268                 return nil, err
269         }
270         switch m := msg.(type) {
271         case *GbpEndpointGroupDetails:
272                 return m, nil
273         case *vpe.ControlPingReply:
274                 err = c.Stream.Close()
275                 if err != nil {
276                         return nil, err
277                 }
278                 return nil, io.EOF
279         default:
280                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
281         }
282 }
283
284 func (c *serviceClient) GbpExtItfAddDel(ctx context.Context, in *GbpExtItfAddDel) (*GbpExtItfAddDelReply, error) {
285         out := new(GbpExtItfAddDelReply)
286         err := c.conn.Invoke(ctx, in, out)
287         if err != nil {
288                 return nil, err
289         }
290         return out, api.RetvalToVPPApiError(out.Retval)
291 }
292
293 func (c *serviceClient) GbpExtItfDump(ctx context.Context, in *GbpExtItfDump) (RPCService_GbpExtItfDumpClient, error) {
294         stream, err := c.conn.NewStream(ctx)
295         if err != nil {
296                 return nil, err
297         }
298         x := &serviceClient_GbpExtItfDumpClient{stream}
299         if err := x.Stream.SendMsg(in); err != nil {
300                 return nil, err
301         }
302         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
303                 return nil, err
304         }
305         return x, nil
306 }
307
308 type RPCService_GbpExtItfDumpClient interface {
309         Recv() (*GbpExtItfDetails, error)
310         api.Stream
311 }
312
313 type serviceClient_GbpExtItfDumpClient struct {
314         api.Stream
315 }
316
317 func (c *serviceClient_GbpExtItfDumpClient) Recv() (*GbpExtItfDetails, error) {
318         msg, err := c.Stream.RecvMsg()
319         if err != nil {
320                 return nil, err
321         }
322         switch m := msg.(type) {
323         case *GbpExtItfDetails:
324                 return m, nil
325         case *vpe.ControlPingReply:
326                 err = c.Stream.Close()
327                 if err != nil {
328                         return nil, err
329                 }
330                 return nil, io.EOF
331         default:
332                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
333         }
334 }
335
336 func (c *serviceClient) GbpRecircAddDel(ctx context.Context, in *GbpRecircAddDel) (*GbpRecircAddDelReply, error) {
337         out := new(GbpRecircAddDelReply)
338         err := c.conn.Invoke(ctx, in, out)
339         if err != nil {
340                 return nil, err
341         }
342         return out, api.RetvalToVPPApiError(out.Retval)
343 }
344
345 func (c *serviceClient) GbpRecircDump(ctx context.Context, in *GbpRecircDump) (RPCService_GbpRecircDumpClient, error) {
346         stream, err := c.conn.NewStream(ctx)
347         if err != nil {
348                 return nil, err
349         }
350         x := &serviceClient_GbpRecircDumpClient{stream}
351         if err := x.Stream.SendMsg(in); err != nil {
352                 return nil, err
353         }
354         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
355                 return nil, err
356         }
357         return x, nil
358 }
359
360 type RPCService_GbpRecircDumpClient interface {
361         Recv() (*GbpRecircDetails, error)
362         api.Stream
363 }
364
365 type serviceClient_GbpRecircDumpClient struct {
366         api.Stream
367 }
368
369 func (c *serviceClient_GbpRecircDumpClient) Recv() (*GbpRecircDetails, error) {
370         msg, err := c.Stream.RecvMsg()
371         if err != nil {
372                 return nil, err
373         }
374         switch m := msg.(type) {
375         case *GbpRecircDetails:
376                 return m, nil
377         case *vpe.ControlPingReply:
378                 err = c.Stream.Close()
379                 if err != nil {
380                         return nil, err
381                 }
382                 return nil, io.EOF
383         default:
384                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
385         }
386 }
387
388 func (c *serviceClient) GbpRouteDomainAdd(ctx context.Context, in *GbpRouteDomainAdd) (*GbpRouteDomainAddReply, error) {
389         out := new(GbpRouteDomainAddReply)
390         err := c.conn.Invoke(ctx, in, out)
391         if err != nil {
392                 return nil, err
393         }
394         return out, api.RetvalToVPPApiError(out.Retval)
395 }
396
397 func (c *serviceClient) GbpRouteDomainDel(ctx context.Context, in *GbpRouteDomainDel) (*GbpRouteDomainDelReply, error) {
398         out := new(GbpRouteDomainDelReply)
399         err := c.conn.Invoke(ctx, in, out)
400         if err != nil {
401                 return nil, err
402         }
403         return out, api.RetvalToVPPApiError(out.Retval)
404 }
405
406 func (c *serviceClient) GbpRouteDomainDump(ctx context.Context, in *GbpRouteDomainDump) (RPCService_GbpRouteDomainDumpClient, error) {
407         stream, err := c.conn.NewStream(ctx)
408         if err != nil {
409                 return nil, err
410         }
411         x := &serviceClient_GbpRouteDomainDumpClient{stream}
412         if err := x.Stream.SendMsg(in); err != nil {
413                 return nil, err
414         }
415         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
416                 return nil, err
417         }
418         return x, nil
419 }
420
421 type RPCService_GbpRouteDomainDumpClient interface {
422         Recv() (*GbpRouteDomainDetails, error)
423         api.Stream
424 }
425
426 type serviceClient_GbpRouteDomainDumpClient struct {
427         api.Stream
428 }
429
430 func (c *serviceClient_GbpRouteDomainDumpClient) Recv() (*GbpRouteDomainDetails, error) {
431         msg, err := c.Stream.RecvMsg()
432         if err != nil {
433                 return nil, err
434         }
435         switch m := msg.(type) {
436         case *GbpRouteDomainDetails:
437                 return m, nil
438         case *vpe.ControlPingReply:
439                 err = c.Stream.Close()
440                 if err != nil {
441                         return nil, err
442                 }
443                 return nil, io.EOF
444         default:
445                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
446         }
447 }
448
449 func (c *serviceClient) GbpSubnetAddDel(ctx context.Context, in *GbpSubnetAddDel) (*GbpSubnetAddDelReply, error) {
450         out := new(GbpSubnetAddDelReply)
451         err := c.conn.Invoke(ctx, in, out)
452         if err != nil {
453                 return nil, err
454         }
455         return out, api.RetvalToVPPApiError(out.Retval)
456 }
457
458 func (c *serviceClient) GbpSubnetDump(ctx context.Context, in *GbpSubnetDump) (RPCService_GbpSubnetDumpClient, error) {
459         stream, err := c.conn.NewStream(ctx)
460         if err != nil {
461                 return nil, err
462         }
463         x := &serviceClient_GbpSubnetDumpClient{stream}
464         if err := x.Stream.SendMsg(in); err != nil {
465                 return nil, err
466         }
467         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
468                 return nil, err
469         }
470         return x, nil
471 }
472
473 type RPCService_GbpSubnetDumpClient interface {
474         Recv() (*GbpSubnetDetails, error)
475         api.Stream
476 }
477
478 type serviceClient_GbpSubnetDumpClient struct {
479         api.Stream
480 }
481
482 func (c *serviceClient_GbpSubnetDumpClient) Recv() (*GbpSubnetDetails, error) {
483         msg, err := c.Stream.RecvMsg()
484         if err != nil {
485                 return nil, err
486         }
487         switch m := msg.(type) {
488         case *GbpSubnetDetails:
489                 return m, nil
490         case *vpe.ControlPingReply:
491                 err = c.Stream.Close()
492                 if err != nil {
493                         return nil, err
494                 }
495                 return nil, io.EOF
496         default:
497                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
498         }
499 }
500
501 func (c *serviceClient) GbpVxlanTunnelAdd(ctx context.Context, in *GbpVxlanTunnelAdd) (*GbpVxlanTunnelAddReply, error) {
502         out := new(GbpVxlanTunnelAddReply)
503         err := c.conn.Invoke(ctx, in, out)
504         if err != nil {
505                 return nil, err
506         }
507         return out, api.RetvalToVPPApiError(out.Retval)
508 }
509
510 func (c *serviceClient) GbpVxlanTunnelDel(ctx context.Context, in *GbpVxlanTunnelDel) (*GbpVxlanTunnelDelReply, error) {
511         out := new(GbpVxlanTunnelDelReply)
512         err := c.conn.Invoke(ctx, in, out)
513         if err != nil {
514                 return nil, err
515         }
516         return out, api.RetvalToVPPApiError(out.Retval)
517 }
518
519 func (c *serviceClient) GbpVxlanTunnelDump(ctx context.Context, in *GbpVxlanTunnelDump) (RPCService_GbpVxlanTunnelDumpClient, error) {
520         stream, err := c.conn.NewStream(ctx)
521         if err != nil {
522                 return nil, err
523         }
524         x := &serviceClient_GbpVxlanTunnelDumpClient{stream}
525         if err := x.Stream.SendMsg(in); err != nil {
526                 return nil, err
527         }
528         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
529                 return nil, err
530         }
531         return x, nil
532 }
533
534 type RPCService_GbpVxlanTunnelDumpClient interface {
535         Recv() (*GbpVxlanTunnelDetails, error)
536         api.Stream
537 }
538
539 type serviceClient_GbpVxlanTunnelDumpClient struct {
540         api.Stream
541 }
542
543 func (c *serviceClient_GbpVxlanTunnelDumpClient) Recv() (*GbpVxlanTunnelDetails, error) {
544         msg, err := c.Stream.RecvMsg()
545         if err != nil {
546                 return nil, err
547         }
548         switch m := msg.(type) {
549         case *GbpVxlanTunnelDetails:
550                 return m, nil
551         case *vpe.ControlPingReply:
552                 err = c.Stream.Close()
553                 if err != nil {
554                         return nil, err
555                 }
556                 return nil, io.EOF
557         default:
558                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
559         }
560 }