8893db8337240722c27707509722c781dd3b24b8
[govpp.git] / binapi / classify / classify_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package classify
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  classify.
14 type RPCService interface {
15         ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error)
16         ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error)
17         ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error)
18         ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error)
19         ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error)
20         ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error)
21         ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error)
22         ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error)
23         FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error)
24         FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error)
25         InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error)
26         OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error)
27         PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error)
28         PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error)
29 }
30
31 type serviceClient struct {
32         conn api.Connection
33 }
34
35 func NewServiceClient(conn api.Connection) RPCService {
36         return &serviceClient{conn}
37 }
38
39 func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
40         out := new(ClassifyAddDelSessionReply)
41         err := c.conn.Invoke(ctx, in, out)
42         if err != nil {
43                 return nil, err
44         }
45         return out, nil
46 }
47
48 func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
49         out := new(ClassifyAddDelTableReply)
50         err := c.conn.Invoke(ctx, in, out)
51         if err != nil {
52                 return nil, err
53         }
54         return out, nil
55 }
56
57 func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
58         stream, err := c.conn.NewStream(ctx)
59         if err != nil {
60                 return nil, err
61         }
62         x := &serviceClient_ClassifySessionDumpClient{stream}
63         if err := x.Stream.SendMsg(in); err != nil {
64                 return nil, err
65         }
66         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
67                 return nil, err
68         }
69         return x, nil
70 }
71
72 type RPCService_ClassifySessionDumpClient interface {
73         Recv() (*ClassifySessionDetails, error)
74         api.Stream
75 }
76
77 type serviceClient_ClassifySessionDumpClient struct {
78         api.Stream
79 }
80
81 func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
82         msg, err := c.Stream.RecvMsg()
83         if err != nil {
84                 return nil, err
85         }
86         switch m := msg.(type) {
87         case *ClassifySessionDetails:
88                 return m, nil
89         case *vpe.ControlPingReply:
90                 return nil, io.EOF
91         default:
92                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
93         }
94 }
95
96 func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
97         out := new(ClassifySetInterfaceIPTableReply)
98         err := c.conn.Invoke(ctx, in, out)
99         if err != nil {
100                 return nil, err
101         }
102         return out, nil
103 }
104
105 func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
106         out := new(ClassifySetInterfaceL2TablesReply)
107         err := c.conn.Invoke(ctx, in, out)
108         if err != nil {
109                 return nil, err
110         }
111         return out, nil
112 }
113
114 func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
115         out := new(ClassifyTableByInterfaceReply)
116         err := c.conn.Invoke(ctx, in, out)
117         if err != nil {
118                 return nil, err
119         }
120         return out, nil
121 }
122
123 func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
124         out := new(ClassifyTableIdsReply)
125         err := c.conn.Invoke(ctx, in, out)
126         if err != nil {
127                 return nil, err
128         }
129         return out, nil
130 }
131
132 func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
133         out := new(ClassifyTableInfoReply)
134         err := c.conn.Invoke(ctx, in, out)
135         if err != nil {
136                 return nil, err
137         }
138         return out, nil
139 }
140
141 func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
142         stream, err := c.conn.NewStream(ctx)
143         if err != nil {
144                 return nil, err
145         }
146         x := &serviceClient_FlowClassifyDumpClient{stream}
147         if err := x.Stream.SendMsg(in); err != nil {
148                 return nil, err
149         }
150         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
151                 return nil, err
152         }
153         return x, nil
154 }
155
156 type RPCService_FlowClassifyDumpClient interface {
157         Recv() (*FlowClassifyDetails, error)
158         api.Stream
159 }
160
161 type serviceClient_FlowClassifyDumpClient struct {
162         api.Stream
163 }
164
165 func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
166         msg, err := c.Stream.RecvMsg()
167         if err != nil {
168                 return nil, err
169         }
170         switch m := msg.(type) {
171         case *FlowClassifyDetails:
172                 return m, nil
173         case *vpe.ControlPingReply:
174                 return nil, io.EOF
175         default:
176                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
177         }
178 }
179
180 func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
181         out := new(FlowClassifySetInterfaceReply)
182         err := c.conn.Invoke(ctx, in, out)
183         if err != nil {
184                 return nil, err
185         }
186         return out, nil
187 }
188
189 func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
190         out := new(InputACLSetInterfaceReply)
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) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
199         out := new(OutputACLSetInterfaceReply)
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) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
208         stream, err := c.conn.NewStream(ctx)
209         if err != nil {
210                 return nil, err
211         }
212         x := &serviceClient_PolicerClassifyDumpClient{stream}
213         if err := x.Stream.SendMsg(in); err != nil {
214                 return nil, err
215         }
216         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
217                 return nil, err
218         }
219         return x, nil
220 }
221
222 type RPCService_PolicerClassifyDumpClient interface {
223         Recv() (*PolicerClassifyDetails, error)
224         api.Stream
225 }
226
227 type serviceClient_PolicerClassifyDumpClient struct {
228         api.Stream
229 }
230
231 func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
232         msg, err := c.Stream.RecvMsg()
233         if err != nil {
234                 return nil, err
235         }
236         switch m := msg.(type) {
237         case *PolicerClassifyDetails:
238                 return m, nil
239         case *vpe.ControlPingReply:
240                 return nil, io.EOF
241         default:
242                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
243         }
244 }
245
246 func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
247         out := new(PolicerClassifySetInterfaceReply)
248         err := c.conn.Invoke(ctx, in, out)
249         if err != nil {
250                 return nil, err
251         }
252         return out, nil
253 }