Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / 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 "git.fd.io/govpp.git/api"
11         vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
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         MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error)
21         MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error)
22         MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error)
23         MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error)
24         MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error)
25         MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error)
26         MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error)
27         MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error)
28         MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error)
29         MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error)
30         MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error)
31 }
32
33 type serviceClient struct {
34         conn api.Connection
35 }
36
37 func NewServiceClient(conn api.Connection) RPCService {
38         return &serviceClient{conn}
39 }
40
41 func (c *serviceClient) MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error) {
42         out := new(MapAddDelRuleReply)
43         err := c.conn.Invoke(ctx, in, out)
44         if err != nil {
45                 return nil, err
46         }
47         return out, api.RetvalToVPPApiError(out.Retval)
48 }
49
50 func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) {
51         out := new(MapAddDomainReply)
52         err := c.conn.Invoke(ctx, in, out)
53         if err != nil {
54                 return nil, err
55         }
56         return out, api.RetvalToVPPApiError(out.Retval)
57 }
58
59 func (c *serviceClient) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) {
60         out := new(MapDelDomainReply)
61         err := c.conn.Invoke(ctx, in, out)
62         if err != nil {
63                 return nil, err
64         }
65         return out, api.RetvalToVPPApiError(out.Retval)
66 }
67
68 func (c *serviceClient) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) {
69         stream, err := c.conn.NewStream(ctx)
70         if err != nil {
71                 return nil, err
72         }
73         x := &serviceClient_MapDomainDumpClient{stream}
74         if err := x.Stream.SendMsg(in); err != nil {
75                 return nil, err
76         }
77         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
78                 return nil, err
79         }
80         return x, nil
81 }
82
83 type RPCService_MapDomainDumpClient interface {
84         Recv() (*MapDomainDetails, error)
85         api.Stream
86 }
87
88 type serviceClient_MapDomainDumpClient struct {
89         api.Stream
90 }
91
92 func (c *serviceClient_MapDomainDumpClient) Recv() (*MapDomainDetails, error) {
93         msg, err := c.Stream.RecvMsg()
94         if err != nil {
95                 return nil, err
96         }
97         switch m := msg.(type) {
98         case *MapDomainDetails:
99                 return m, nil
100         case *vpe.ControlPingReply:
101                 err = c.Stream.Close()
102                 if err != nil {
103                         return nil, err
104                 }
105                 return nil, io.EOF
106         default:
107                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
108         }
109 }
110
111 func (c *serviceClient) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) {
112         out := new(MapIfEnableDisableReply)
113         err := c.conn.Invoke(ctx, in, out)
114         if err != nil {
115                 return nil, err
116         }
117         return out, api.RetvalToVPPApiError(out.Retval)
118 }
119
120 func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) {
121         out := new(MapParamAddDelPreResolveReply)
122         err := c.conn.Invoke(ctx, in, out)
123         if err != nil {
124                 return nil, err
125         }
126         return out, api.RetvalToVPPApiError(out.Retval)
127 }
128
129 func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) {
130         out := new(MapParamGetReply)
131         err := c.conn.Invoke(ctx, in, out)
132         if err != nil {
133                 return nil, err
134         }
135         return out, api.RetvalToVPPApiError(out.Retval)
136 }
137
138 func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) {
139         out := new(MapParamSetFragmentationReply)
140         err := c.conn.Invoke(ctx, in, out)
141         if err != nil {
142                 return nil, err
143         }
144         return out, api.RetvalToVPPApiError(out.Retval)
145 }
146
147 func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) {
148         out := new(MapParamSetICMPReply)
149         err := c.conn.Invoke(ctx, in, out)
150         if err != nil {
151                 return nil, err
152         }
153         return out, api.RetvalToVPPApiError(out.Retval)
154 }
155
156 func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) {
157         out := new(MapParamSetICMP6Reply)
158         err := c.conn.Invoke(ctx, in, out)
159         if err != nil {
160                 return nil, err
161         }
162         return out, api.RetvalToVPPApiError(out.Retval)
163 }
164
165 func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) {
166         out := new(MapParamSetSecurityCheckReply)
167         err := c.conn.Invoke(ctx, in, out)
168         if err != nil {
169                 return nil, err
170         }
171         return out, api.RetvalToVPPApiError(out.Retval)
172 }
173
174 func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) {
175         out := new(MapParamSetTCPReply)
176         err := c.conn.Invoke(ctx, in, out)
177         if err != nil {
178                 return nil, err
179         }
180         return out, api.RetvalToVPPApiError(out.Retval)
181 }
182
183 func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) {
184         out := new(MapParamSetTrafficClassReply)
185         err := c.conn.Invoke(ctx, in, out)
186         if err != nil {
187                 return nil, err
188         }
189         return out, api.RetvalToVPPApiError(out.Retval)
190 }
191
192 func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) {
193         stream, err := c.conn.NewStream(ctx)
194         if err != nil {
195                 return nil, err
196         }
197         x := &serviceClient_MapRuleDumpClient{stream}
198         if err := x.Stream.SendMsg(in); err != nil {
199                 return nil, err
200         }
201         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
202                 return nil, err
203         }
204         return x, nil
205 }
206
207 type RPCService_MapRuleDumpClient interface {
208         Recv() (*MapRuleDetails, error)
209         api.Stream
210 }
211
212 type serviceClient_MapRuleDumpClient struct {
213         api.Stream
214 }
215
216 func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) {
217         msg, err := c.Stream.RecvMsg()
218         if err != nil {
219                 return nil, err
220         }
221         switch m := msg.(type) {
222         case *MapRuleDetails:
223                 return m, nil
224         case *vpe.ControlPingReply:
225                 err = c.Stream.Close()
226                 if err != nil {
227                         return nil, err
228                 }
229                 return nil, io.EOF
230         default:
231                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
232         }
233 }
234
235 func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error) {
236         out := new(MapSummaryStatsReply)
237         err := c.conn.Invoke(ctx, in, out)
238         if err != nil {
239                 return nil, err
240         }
241         return out, api.RetvalToVPPApiError(out.Retval)
242 }