Change module name to go.fd.io/govpp
[govpp.git] / binapi / map / map_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package maps
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "go.fd.io/govpp/api"
11         memclnt "go.fd.io/govpp/binapi/memclnt"
12 )
13
14 // RPCService defines RPC service map.
15 type RPCService interface {
16         MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error)
17         MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error)
18         MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error)
19         MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error)
20         MapDomainsGet(ctx context.Context, in *MapDomainsGet) (RPCService_MapDomainsGetClient, error)
21         MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error)
22         MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error)
23         MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error)
24         MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error)
25         MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error)
26         MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error)
27         MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error)
28         MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error)
29         MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error)
30         MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error)
31         MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error)
32 }
33
34 type serviceClient struct {
35         conn api.Connection
36 }
37
38 func NewServiceClient(conn api.Connection) RPCService {
39         return &serviceClient{conn}
40 }
41
42 func (c *serviceClient) MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error) {
43         out := new(MapAddDelRuleReply)
44         err := c.conn.Invoke(ctx, in, out)
45         if err != nil {
46                 return nil, err
47         }
48         return out, api.RetvalToVPPApiError(out.Retval)
49 }
50
51 func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) {
52         out := new(MapAddDomainReply)
53         err := c.conn.Invoke(ctx, in, out)
54         if err != nil {
55                 return nil, err
56         }
57         return out, api.RetvalToVPPApiError(out.Retval)
58 }
59
60 func (c *serviceClient) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) {
61         out := new(MapDelDomainReply)
62         err := c.conn.Invoke(ctx, in, out)
63         if err != nil {
64                 return nil, err
65         }
66         return out, api.RetvalToVPPApiError(out.Retval)
67 }
68
69 func (c *serviceClient) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) {
70         stream, err := c.conn.NewStream(ctx)
71         if err != nil {
72                 return nil, err
73         }
74         x := &serviceClient_MapDomainDumpClient{stream}
75         if err := x.Stream.SendMsg(in); err != nil {
76                 return nil, err
77         }
78         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
79                 return nil, err
80         }
81         return x, nil
82 }
83
84 type RPCService_MapDomainDumpClient interface {
85         Recv() (*MapDomainDetails, error)
86         api.Stream
87 }
88
89 type serviceClient_MapDomainDumpClient struct {
90         api.Stream
91 }
92
93 func (c *serviceClient_MapDomainDumpClient) Recv() (*MapDomainDetails, error) {
94         msg, err := c.Stream.RecvMsg()
95         if err != nil {
96                 return nil, err
97         }
98         switch m := msg.(type) {
99         case *MapDomainDetails:
100                 return m, nil
101         case *memclnt.ControlPingReply:
102                 err = c.Stream.Close()
103                 if err != nil {
104                         return nil, err
105                 }
106                 return nil, io.EOF
107         default:
108                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
109         }
110 }
111
112 func (c *serviceClient) MapDomainsGet(ctx context.Context, in *MapDomainsGet) (RPCService_MapDomainsGetClient, error) {
113         stream, err := c.conn.NewStream(ctx)
114         if err != nil {
115                 return nil, err
116         }
117         x := &serviceClient_MapDomainsGetClient{stream}
118         if err := x.Stream.SendMsg(in); err != nil {
119                 return nil, err
120         }
121         return x, nil
122 }
123
124 type RPCService_MapDomainsGetClient interface {
125         Recv() (*MapDomainDetails, error)
126         api.Stream
127 }
128
129 type serviceClient_MapDomainsGetClient struct {
130         api.Stream
131 }
132
133 func (c *serviceClient_MapDomainsGetClient) Recv() (*MapDomainDetails, error) {
134         msg, err := c.Stream.RecvMsg()
135         if err != nil {
136                 return nil, err
137         }
138         switch m := msg.(type) {
139         case *MapDomainDetails:
140                 return m, nil
141         case *MapDomainsGetReply:
142                 err = c.Stream.Close()
143                 if err != nil {
144                         return nil, err
145                 }
146                 return nil, io.EOF
147         default:
148                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
149         }
150 }
151
152 func (c *serviceClient) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) {
153         out := new(MapIfEnableDisableReply)
154         err := c.conn.Invoke(ctx, in, out)
155         if err != nil {
156                 return nil, err
157         }
158         return out, api.RetvalToVPPApiError(out.Retval)
159 }
160
161 func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) {
162         out := new(MapParamAddDelPreResolveReply)
163         err := c.conn.Invoke(ctx, in, out)
164         if err != nil {
165                 return nil, err
166         }
167         return out, api.RetvalToVPPApiError(out.Retval)
168 }
169
170 func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) {
171         out := new(MapParamGetReply)
172         err := c.conn.Invoke(ctx, in, out)
173         if err != nil {
174                 return nil, err
175         }
176         return out, api.RetvalToVPPApiError(out.Retval)
177 }
178
179 func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) {
180         out := new(MapParamSetFragmentationReply)
181         err := c.conn.Invoke(ctx, in, out)
182         if err != nil {
183                 return nil, err
184         }
185         return out, api.RetvalToVPPApiError(out.Retval)
186 }
187
188 func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) {
189         out := new(MapParamSetICMPReply)
190         err := c.conn.Invoke(ctx, in, out)
191         if err != nil {
192                 return nil, err
193         }
194         return out, api.RetvalToVPPApiError(out.Retval)
195 }
196
197 func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) {
198         out := new(MapParamSetICMP6Reply)
199         err := c.conn.Invoke(ctx, in, out)
200         if err != nil {
201                 return nil, err
202         }
203         return out, api.RetvalToVPPApiError(out.Retval)
204 }
205
206 func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) {
207         out := new(MapParamSetSecurityCheckReply)
208         err := c.conn.Invoke(ctx, in, out)
209         if err != nil {
210                 return nil, err
211         }
212         return out, api.RetvalToVPPApiError(out.Retval)
213 }
214
215 func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) {
216         out := new(MapParamSetTCPReply)
217         err := c.conn.Invoke(ctx, in, out)
218         if err != nil {
219                 return nil, err
220         }
221         return out, api.RetvalToVPPApiError(out.Retval)
222 }
223
224 func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) {
225         out := new(MapParamSetTrafficClassReply)
226         err := c.conn.Invoke(ctx, in, out)
227         if err != nil {
228                 return nil, err
229         }
230         return out, api.RetvalToVPPApiError(out.Retval)
231 }
232
233 func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) {
234         stream, err := c.conn.NewStream(ctx)
235         if err != nil {
236                 return nil, err
237         }
238         x := &serviceClient_MapRuleDumpClient{stream}
239         if err := x.Stream.SendMsg(in); err != nil {
240                 return nil, err
241         }
242         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
243                 return nil, err
244         }
245         return x, nil
246 }
247
248 type RPCService_MapRuleDumpClient interface {
249         Recv() (*MapRuleDetails, error)
250         api.Stream
251 }
252
253 type serviceClient_MapRuleDumpClient struct {
254         api.Stream
255 }
256
257 func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) {
258         msg, err := c.Stream.RecvMsg()
259         if err != nil {
260                 return nil, err
261         }
262         switch m := msg.(type) {
263         case *MapRuleDetails:
264                 return m, nil
265         case *memclnt.ControlPingReply:
266                 err = c.Stream.Close()
267                 if err != nil {
268                         return nil, err
269                 }
270                 return nil, io.EOF
271         default:
272                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
273         }
274 }
275
276 func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error) {
277         out := new(MapSummaryStatsReply)
278         err := c.conn.Invoke(ctx, in, out)
279         if err != nil {
280                 return nil, err
281         }
282         return out, api.RetvalToVPPApiError(out.Retval)
283 }