Improve doc & fix import ordering
[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         "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  classify.
15 type RPCService interface {
16         ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error)
17         ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error)
18         ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error)
19         ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error)
20         ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error)
21         ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error)
22         ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error)
23         ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error)
24         FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error)
25         FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error)
26         InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error)
27         OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error)
28         PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error)
29         PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, 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) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
41         out := new(ClassifyAddDelSessionReply)
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) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
50         out := new(ClassifyAddDelTableReply)
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) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
59         stream, err := c.conn.NewStream(ctx)
60         if err != nil {
61                 return nil, err
62         }
63         x := &serviceClient_ClassifySessionDumpClient{stream}
64         if err := x.Stream.SendMsg(in); err != nil {
65                 return nil, err
66         }
67         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
68                 return nil, err
69         }
70         return x, nil
71 }
72
73 type RPCService_ClassifySessionDumpClient interface {
74         Recv() (*ClassifySessionDetails, error)
75         api.Stream
76 }
77
78 type serviceClient_ClassifySessionDumpClient struct {
79         api.Stream
80 }
81
82 func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
83         msg, err := c.Stream.RecvMsg()
84         if err != nil {
85                 return nil, err
86         }
87         switch m := msg.(type) {
88         case *ClassifySessionDetails:
89                 return m, nil
90         case *vpe.ControlPingReply:
91                 return nil, io.EOF
92         default:
93                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
94         }
95 }
96
97 func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
98         out := new(ClassifySetInterfaceIPTableReply)
99         err := c.conn.Invoke(ctx, in, out)
100         if err != nil {
101                 return nil, err
102         }
103         return out, nil
104 }
105
106 func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
107         out := new(ClassifySetInterfaceL2TablesReply)
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) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
116         out := new(ClassifyTableByInterfaceReply)
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) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
125         out := new(ClassifyTableIdsReply)
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) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
134         out := new(ClassifyTableInfoReply)
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) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
143         stream, err := c.conn.NewStream(ctx)
144         if err != nil {
145                 return nil, err
146         }
147         x := &serviceClient_FlowClassifyDumpClient{stream}
148         if err := x.Stream.SendMsg(in); err != nil {
149                 return nil, err
150         }
151         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
152                 return nil, err
153         }
154         return x, nil
155 }
156
157 type RPCService_FlowClassifyDumpClient interface {
158         Recv() (*FlowClassifyDetails, error)
159         api.Stream
160 }
161
162 type serviceClient_FlowClassifyDumpClient struct {
163         api.Stream
164 }
165
166 func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
167         msg, err := c.Stream.RecvMsg()
168         if err != nil {
169                 return nil, err
170         }
171         switch m := msg.(type) {
172         case *FlowClassifyDetails:
173                 return m, nil
174         case *vpe.ControlPingReply:
175                 return nil, io.EOF
176         default:
177                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
178         }
179 }
180
181 func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
182         out := new(FlowClassifySetInterfaceReply)
183         err := c.conn.Invoke(ctx, in, out)
184         if err != nil {
185                 return nil, err
186         }
187         return out, nil
188 }
189
190 func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
191         out := new(InputACLSetInterfaceReply)
192         err := c.conn.Invoke(ctx, in, out)
193         if err != nil {
194                 return nil, err
195         }
196         return out, nil
197 }
198
199 func (c *serviceClient) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
200         out := new(OutputACLSetInterfaceReply)
201         err := c.conn.Invoke(ctx, in, out)
202         if err != nil {
203                 return nil, err
204         }
205         return out, nil
206 }
207
208 func (c *serviceClient) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
209         stream, err := c.conn.NewStream(ctx)
210         if err != nil {
211                 return nil, err
212         }
213         x := &serviceClient_PolicerClassifyDumpClient{stream}
214         if err := x.Stream.SendMsg(in); err != nil {
215                 return nil, err
216         }
217         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
218                 return nil, err
219         }
220         return x, nil
221 }
222
223 type RPCService_PolicerClassifyDumpClient interface {
224         Recv() (*PolicerClassifyDetails, error)
225         api.Stream
226 }
227
228 type serviceClient_PolicerClassifyDumpClient struct {
229         api.Stream
230 }
231
232 func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
233         msg, err := c.Stream.RecvMsg()
234         if err != nil {
235                 return nil, err
236         }
237         switch m := msg.(type) {
238         case *PolicerClassifyDetails:
239                 return m, nil
240         case *vpe.ControlPingReply:
241                 return nil, io.EOF
242         default:
243                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
244         }
245 }
246
247 func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
248         out := new(PolicerClassifySetInterfaceReply)
249         err := c.conn.Invoke(ctx, in, out)
250         if err != nil {
251                 return nil, err
252         }
253         return out, nil
254 }