6f7c3c749d57f129d05a697db3101abd0f238b21
[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         api "git.fd.io/govpp.git/api"
9         vpe "git.fd.io/govpp.git/binapi/vpe"
10         "io"
11 )
12
13 // RPCService defines RPC service  map.
14 type RPCService interface {
15         MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error)
16         MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error)
17         MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error)
18         MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error)
19         MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error)
20         MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error)
21         MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error)
22         MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error)
23         MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error)
24         MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error)
25         MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error)
26         MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error)
27         MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error)
28         MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error)
29         MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error)
30 }
31
32 type serviceClient struct {
33         conn api.Connection
34 }
35
36 func NewServiceClient(conn api.Connection) RPCService {
37         return &serviceClient{conn}
38 }
39
40 func (c *serviceClient) MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error) {
41         out := new(MapAddDelRuleReply)
42         err := c.conn.Invoke(ctx, in, out)
43         if err != nil {
44                 return nil, err
45         }
46         return out, nil
47 }
48
49 func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) {
50         out := new(MapAddDomainReply)
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) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) {
59         out := new(MapDelDomainReply)
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) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) {
68         stream, err := c.conn.NewStream(ctx)
69         if err != nil {
70                 return nil, err
71         }
72         x := &serviceClient_MapDomainDumpClient{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_MapDomainDumpClient interface {
83         Recv() (*MapDomainDetails, error)
84         api.Stream
85 }
86
87 type serviceClient_MapDomainDumpClient struct {
88         api.Stream
89 }
90
91 func (c *serviceClient_MapDomainDumpClient) Recv() (*MapDomainDetails, error) {
92         msg, err := c.Stream.RecvMsg()
93         if err != nil {
94                 return nil, err
95         }
96         switch m := msg.(type) {
97         case *MapDomainDetails:
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) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) {
107         out := new(MapIfEnableDisableReply)
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) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) {
116         out := new(MapParamAddDelPreResolveReply)
117         err := c.conn.Invoke(ctx, in, out)
118         if err != nil {
119                 return nil, err
120         }
121         return out, nil
122 }
123
124 func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) {
125         out := new(MapParamGetReply)
126         err := c.conn.Invoke(ctx, in, out)
127         if err != nil {
128                 return nil, err
129         }
130         return out, nil
131 }
132
133 func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) {
134         out := new(MapParamSetFragmentationReply)
135         err := c.conn.Invoke(ctx, in, out)
136         if err != nil {
137                 return nil, err
138         }
139         return out, nil
140 }
141
142 func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) {
143         out := new(MapParamSetICMPReply)
144         err := c.conn.Invoke(ctx, in, out)
145         if err != nil {
146                 return nil, err
147         }
148         return out, nil
149 }
150
151 func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) {
152         out := new(MapParamSetICMP6Reply)
153         err := c.conn.Invoke(ctx, in, out)
154         if err != nil {
155                 return nil, err
156         }
157         return out, nil
158 }
159
160 func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) {
161         out := new(MapParamSetSecurityCheckReply)
162         err := c.conn.Invoke(ctx, in, out)
163         if err != nil {
164                 return nil, err
165         }
166         return out, nil
167 }
168
169 func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) {
170         out := new(MapParamSetTCPReply)
171         err := c.conn.Invoke(ctx, in, out)
172         if err != nil {
173                 return nil, err
174         }
175         return out, nil
176 }
177
178 func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) {
179         out := new(MapParamSetTrafficClassReply)
180         err := c.conn.Invoke(ctx, in, out)
181         if err != nil {
182                 return nil, err
183         }
184         return out, nil
185 }
186
187 func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) {
188         stream, err := c.conn.NewStream(ctx)
189         if err != nil {
190                 return nil, err
191         }
192         x := &serviceClient_MapRuleDumpClient{stream}
193         if err := x.Stream.SendMsg(in); err != nil {
194                 return nil, err
195         }
196         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
197                 return nil, err
198         }
199         return x, nil
200 }
201
202 type RPCService_MapRuleDumpClient interface {
203         Recv() (*MapRuleDetails, error)
204         api.Stream
205 }
206
207 type serviceClient_MapRuleDumpClient struct {
208         api.Stream
209 }
210
211 func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) {
212         msg, err := c.Stream.RecvMsg()
213         if err != nil {
214                 return nil, err
215         }
216         switch m := msg.(type) {
217         case *MapRuleDetails:
218                 return m, nil
219         case *vpe.ControlPingReply:
220                 return nil, io.EOF
221         default:
222                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
223         }
224 }
225
226 func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error) {
227         out := new(MapSummaryStatsReply)
228         err := c.conn.Invoke(ctx, in, out)
229         if err != nil {
230                 return nil, err
231         }
232         return out, nil
233 }