Improve doc & fix import ordering
[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 "git.fd.io/govpp.git/api"
11         vpe "git.fd.io/govpp.git/binapi/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, nil
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, nil
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, nil
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                 return nil, io.EOF
102         default:
103                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
104         }
105 }
106
107 func (c *serviceClient) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) {
108         out := new(MapIfEnableDisableReply)
109         err := c.conn.Invoke(ctx, in, out)
110         if err != nil {
111                 return nil, err
112         }
113         return out, nil
114 }
115
116 func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) {
117         out := new(MapParamAddDelPreResolveReply)
118         err := c.conn.Invoke(ctx, in, out)
119         if err != nil {
120                 return nil, err
121         }
122         return out, nil
123 }
124
125 func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) {
126         out := new(MapParamGetReply)
127         err := c.conn.Invoke(ctx, in, out)
128         if err != nil {
129                 return nil, err
130         }
131         return out, nil
132 }
133
134 func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) {
135         out := new(MapParamSetFragmentationReply)
136         err := c.conn.Invoke(ctx, in, out)
137         if err != nil {
138                 return nil, err
139         }
140         return out, nil
141 }
142
143 func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) {
144         out := new(MapParamSetICMPReply)
145         err := c.conn.Invoke(ctx, in, out)
146         if err != nil {
147                 return nil, err
148         }
149         return out, nil
150 }
151
152 func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) {
153         out := new(MapParamSetICMP6Reply)
154         err := c.conn.Invoke(ctx, in, out)
155         if err != nil {
156                 return nil, err
157         }
158         return out, nil
159 }
160
161 func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) {
162         out := new(MapParamSetSecurityCheckReply)
163         err := c.conn.Invoke(ctx, in, out)
164         if err != nil {
165                 return nil, err
166         }
167         return out, nil
168 }
169
170 func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) {
171         out := new(MapParamSetTCPReply)
172         err := c.conn.Invoke(ctx, in, out)
173         if err != nil {
174                 return nil, err
175         }
176         return out, nil
177 }
178
179 func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) {
180         out := new(MapParamSetTrafficClassReply)
181         err := c.conn.Invoke(ctx, in, out)
182         if err != nil {
183                 return nil, err
184         }
185         return out, nil
186 }
187
188 func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) {
189         stream, err := c.conn.NewStream(ctx)
190         if err != nil {
191                 return nil, err
192         }
193         x := &serviceClient_MapRuleDumpClient{stream}
194         if err := x.Stream.SendMsg(in); err != nil {
195                 return nil, err
196         }
197         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
198                 return nil, err
199         }
200         return x, nil
201 }
202
203 type RPCService_MapRuleDumpClient interface {
204         Recv() (*MapRuleDetails, error)
205         api.Stream
206 }
207
208 type serviceClient_MapRuleDumpClient struct {
209         api.Stream
210 }
211
212 func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) {
213         msg, err := c.Stream.RecvMsg()
214         if err != nil {
215                 return nil, err
216         }
217         switch m := msg.(type) {
218         case *MapRuleDetails:
219                 return m, nil
220         case *vpe.ControlPingReply:
221                 return nil, io.EOF
222         default:
223                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
224         }
225 }
226
227 func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error) {
228         out := new(MapSummaryStatsReply)
229         err := c.conn.Invoke(ctx, in, out)
230         if err != nil {
231                 return nil, err
232         }
233         return out, nil
234 }