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