Improve doc & fix import ordering
[govpp.git] / binapi / acl / acl_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package acl
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  acl.
15 type RPCService interface {
16         ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error)
17         ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error)
18         ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error)
19         ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error)
20         ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error)
21         ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error)
22         ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error)
23         ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error)
24         ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error)
25         ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error)
26         ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error)
27         ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error)
28         MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error)
29         MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error)
30         MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error)
31         MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error)
32         MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error)
33         MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error)
34         MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error)
35 }
36
37 type serviceClient struct {
38         conn api.Connection
39 }
40
41 func NewServiceClient(conn api.Connection) RPCService {
42         return &serviceClient{conn}
43 }
44
45 func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) {
46         out := new(ACLAddReplaceReply)
47         err := c.conn.Invoke(ctx, in, out)
48         if err != nil {
49                 return nil, err
50         }
51         return out, nil
52 }
53
54 func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) {
55         out := new(ACLDelReply)
56         err := c.conn.Invoke(ctx, in, out)
57         if err != nil {
58                 return nil, err
59         }
60         return out, nil
61 }
62
63 func (c *serviceClient) ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error) {
64         stream, err := c.conn.NewStream(ctx)
65         if err != nil {
66                 return nil, err
67         }
68         x := &serviceClient_ACLDumpClient{stream}
69         if err := x.Stream.SendMsg(in); err != nil {
70                 return nil, err
71         }
72         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
73                 return nil, err
74         }
75         return x, nil
76 }
77
78 type RPCService_ACLDumpClient interface {
79         Recv() (*ACLDetails, error)
80         api.Stream
81 }
82
83 type serviceClient_ACLDumpClient struct {
84         api.Stream
85 }
86
87 func (c *serviceClient_ACLDumpClient) Recv() (*ACLDetails, error) {
88         msg, err := c.Stream.RecvMsg()
89         if err != nil {
90                 return nil, err
91         }
92         switch m := msg.(type) {
93         case *ACLDetails:
94                 return m, nil
95         case *vpe.ControlPingReply:
96                 return nil, io.EOF
97         default:
98                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
99         }
100 }
101
102 func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) {
103         out := new(ACLInterfaceAddDelReply)
104         err := c.conn.Invoke(ctx, in, out)
105         if err != nil {
106                 return nil, err
107         }
108         return out, nil
109 }
110
111 func (c *serviceClient) ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error) {
112         stream, err := c.conn.NewStream(ctx)
113         if err != nil {
114                 return nil, err
115         }
116         x := &serviceClient_ACLInterfaceEtypeWhitelistDumpClient{stream}
117         if err := x.Stream.SendMsg(in); err != nil {
118                 return nil, err
119         }
120         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
121                 return nil, err
122         }
123         return x, nil
124 }
125
126 type RPCService_ACLInterfaceEtypeWhitelistDumpClient interface {
127         Recv() (*ACLInterfaceEtypeWhitelistDetails, error)
128         api.Stream
129 }
130
131 type serviceClient_ACLInterfaceEtypeWhitelistDumpClient struct {
132         api.Stream
133 }
134
135 func (c *serviceClient_ACLInterfaceEtypeWhitelistDumpClient) Recv() (*ACLInterfaceEtypeWhitelistDetails, error) {
136         msg, err := c.Stream.RecvMsg()
137         if err != nil {
138                 return nil, err
139         }
140         switch m := msg.(type) {
141         case *ACLInterfaceEtypeWhitelistDetails:
142                 return m, nil
143         case *vpe.ControlPingReply:
144                 return nil, io.EOF
145         default:
146                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
147         }
148 }
149
150 func (c *serviceClient) ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error) {
151         stream, err := c.conn.NewStream(ctx)
152         if err != nil {
153                 return nil, err
154         }
155         x := &serviceClient_ACLInterfaceListDumpClient{stream}
156         if err := x.Stream.SendMsg(in); err != nil {
157                 return nil, err
158         }
159         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
160                 return nil, err
161         }
162         return x, nil
163 }
164
165 type RPCService_ACLInterfaceListDumpClient interface {
166         Recv() (*ACLInterfaceListDetails, error)
167         api.Stream
168 }
169
170 type serviceClient_ACLInterfaceListDumpClient struct {
171         api.Stream
172 }
173
174 func (c *serviceClient_ACLInterfaceListDumpClient) Recv() (*ACLInterfaceListDetails, error) {
175         msg, err := c.Stream.RecvMsg()
176         if err != nil {
177                 return nil, err
178         }
179         switch m := msg.(type) {
180         case *ACLInterfaceListDetails:
181                 return m, nil
182         case *vpe.ControlPingReply:
183                 return nil, io.EOF
184         default:
185                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
186         }
187 }
188
189 func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error) {
190         out := new(ACLInterfaceSetACLListReply)
191         err := c.conn.Invoke(ctx, in, out)
192         if err != nil {
193                 return nil, err
194         }
195         return out, nil
196 }
197
198 func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) {
199         out := new(ACLInterfaceSetEtypeWhitelistReply)
200         err := c.conn.Invoke(ctx, in, out)
201         if err != nil {
202                 return nil, err
203         }
204         return out, nil
205 }
206
207 func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) {
208         out := new(ACLPluginControlPingReply)
209         err := c.conn.Invoke(ctx, in, out)
210         if err != nil {
211                 return nil, err
212         }
213         return out, nil
214 }
215
216 func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) {
217         out := new(ACLPluginGetConnTableMaxEntriesReply)
218         err := c.conn.Invoke(ctx, in, out)
219         if err != nil {
220                 return nil, err
221         }
222         return out, nil
223 }
224
225 func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) {
226         out := new(ACLPluginGetVersionReply)
227         err := c.conn.Invoke(ctx, in, out)
228         if err != nil {
229                 return nil, err
230         }
231         return out, nil
232 }
233
234 func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) {
235         out := new(ACLStatsIntfCountersEnableReply)
236         err := c.conn.Invoke(ctx, in, out)
237         if err != nil {
238                 return nil, err
239         }
240         return out, nil
241 }
242
243 func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) {
244         out := new(MacipACLAddReply)
245         err := c.conn.Invoke(ctx, in, out)
246         if err != nil {
247                 return nil, err
248         }
249         return out, nil
250 }
251
252 func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) {
253         out := new(MacipACLAddReplaceReply)
254         err := c.conn.Invoke(ctx, in, out)
255         if err != nil {
256                 return nil, err
257         }
258         return out, nil
259 }
260
261 func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error) {
262         out := new(MacipACLDelReply)
263         err := c.conn.Invoke(ctx, in, out)
264         if err != nil {
265                 return nil, err
266         }
267         return out, nil
268 }
269
270 func (c *serviceClient) MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error) {
271         stream, err := c.conn.NewStream(ctx)
272         if err != nil {
273                 return nil, err
274         }
275         x := &serviceClient_MacipACLDumpClient{stream}
276         if err := x.Stream.SendMsg(in); err != nil {
277                 return nil, err
278         }
279         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
280                 return nil, err
281         }
282         return x, nil
283 }
284
285 type RPCService_MacipACLDumpClient interface {
286         Recv() (*MacipACLDetails, error)
287         api.Stream
288 }
289
290 type serviceClient_MacipACLDumpClient struct {
291         api.Stream
292 }
293
294 func (c *serviceClient_MacipACLDumpClient) Recv() (*MacipACLDetails, error) {
295         msg, err := c.Stream.RecvMsg()
296         if err != nil {
297                 return nil, err
298         }
299         switch m := msg.(type) {
300         case *MacipACLDetails:
301                 return m, nil
302         case *vpe.ControlPingReply:
303                 return nil, io.EOF
304         default:
305                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
306         }
307 }
308
309 func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error) {
310         out := new(MacipACLInterfaceAddDelReply)
311         err := c.conn.Invoke(ctx, in, out)
312         if err != nil {
313                 return nil, err
314         }
315         return out, nil
316 }
317
318 func (c *serviceClient) MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) {
319         out := new(MacipACLInterfaceGetReply)
320         err := c.conn.Invoke(ctx, in, out)
321         if err != nil {
322                 return nil, err
323         }
324         return out, nil
325 }
326
327 func (c *serviceClient) MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error) {
328         stream, err := c.conn.NewStream(ctx)
329         if err != nil {
330                 return nil, err
331         }
332         x := &serviceClient_MacipACLInterfaceListDumpClient{stream}
333         if err := x.Stream.SendMsg(in); err != nil {
334                 return nil, err
335         }
336         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
337                 return nil, err
338         }
339         return x, nil
340 }
341
342 type RPCService_MacipACLInterfaceListDumpClient interface {
343         Recv() (*MacipACLInterfaceListDetails, error)
344         api.Stream
345 }
346
347 type serviceClient_MacipACLInterfaceListDumpClient struct {
348         api.Stream
349 }
350
351 func (c *serviceClient_MacipACLInterfaceListDumpClient) Recv() (*MacipACLInterfaceListDetails, error) {
352         msg, err := c.Stream.RecvMsg()
353         if err != nil {
354                 return nil, err
355         }
356         switch m := msg.(type) {
357         case *MacipACLInterfaceListDetails:
358                 return m, nil
359         case *vpe.ControlPingReply:
360                 return nil, io.EOF
361         default:
362                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
363         }
364 }