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