519aa06ff03a4e5aec9ee629fbd45a43d8119999
[govpp.git] / internal / testbinapi / binapi2001 / session / session_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package session
4
5 import (
6         "context"
7         "fmt"
8         api "git.fd.io/govpp.git/api"
9         vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
10         "io"
11 )
12
13 // RPCService defines RPC service  session.
14 type RPCService interface {
15         AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error)
16         AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error)
17         AppCutThroughRegistrationAdd(ctx context.Context, in *AppCutThroughRegistrationAdd) (*AppCutThroughRegistrationAddReply, error)
18         AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error)
19         AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error)
20         AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error)
21         ApplicationAttach(ctx context.Context, in *ApplicationAttach) (*ApplicationAttachReply, error)
22         ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error)
23         ApplicationTLSCertAdd(ctx context.Context, in *ApplicationTLSCertAdd) (*ApplicationTLSCertAddReply, error)
24         ApplicationTLSKeyAdd(ctx context.Context, in *ApplicationTLSKeyAdd) (*ApplicationTLSKeyAddReply, error)
25         BindSock(ctx context.Context, in *BindSock) (*BindSockReply, error)
26         BindURI(ctx context.Context, in *BindURI) (*BindURIReply, error)
27         ConnectSock(ctx context.Context, in *ConnectSock) (*ConnectSockReply, error)
28         ConnectURI(ctx context.Context, in *ConnectURI) (*ConnectURIReply, error)
29         DisconnectSession(ctx context.Context, in *DisconnectSession) (*DisconnectSessionReply, error)
30         MapAnotherSegment(ctx context.Context, in *MapAnotherSegment) (*MapAnotherSegmentReply, error)
31         SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error)
32         SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error)
33         SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error)
34         UnbindSock(ctx context.Context, in *UnbindSock) (*UnbindSockReply, error)
35         UnbindURI(ctx context.Context, in *UnbindURI) (*UnbindURIReply, error)
36         UnmapSegment(ctx context.Context, in *UnmapSegment) (*UnmapSegmentReply, error)
37 }
38
39 type serviceClient struct {
40         conn api.Connection
41 }
42
43 func NewServiceClient(conn api.Connection) RPCService {
44         return &serviceClient{conn}
45 }
46
47 func (c *serviceClient) AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error) {
48         out := new(AppAddCertKeyPairReply)
49         err := c.conn.Invoke(ctx, in, out)
50         if err != nil {
51                 return nil, err
52         }
53         return out, nil
54 }
55
56 func (c *serviceClient) AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error) {
57         out := new(AppAttachReply)
58         err := c.conn.Invoke(ctx, in, out)
59         if err != nil {
60                 return nil, err
61         }
62         return out, nil
63 }
64
65 func (c *serviceClient) AppCutThroughRegistrationAdd(ctx context.Context, in *AppCutThroughRegistrationAdd) (*AppCutThroughRegistrationAddReply, error) {
66         out := new(AppCutThroughRegistrationAddReply)
67         err := c.conn.Invoke(ctx, in, out)
68         if err != nil {
69                 return nil, err
70         }
71         return out, nil
72 }
73
74 func (c *serviceClient) AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error) {
75         out := new(AppDelCertKeyPairReply)
76         err := c.conn.Invoke(ctx, in, out)
77         if err != nil {
78                 return nil, err
79         }
80         return out, nil
81 }
82
83 func (c *serviceClient) AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error) {
84         out := new(AppNamespaceAddDelReply)
85         err := c.conn.Invoke(ctx, in, out)
86         if err != nil {
87                 return nil, err
88         }
89         return out, nil
90 }
91
92 func (c *serviceClient) AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error) {
93         out := new(AppWorkerAddDelReply)
94         err := c.conn.Invoke(ctx, in, out)
95         if err != nil {
96                 return nil, err
97         }
98         return out, nil
99 }
100
101 func (c *serviceClient) ApplicationAttach(ctx context.Context, in *ApplicationAttach) (*ApplicationAttachReply, error) {
102         out := new(ApplicationAttachReply)
103         err := c.conn.Invoke(ctx, in, out)
104         if err != nil {
105                 return nil, err
106         }
107         return out, nil
108 }
109
110 func (c *serviceClient) ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error) {
111         out := new(ApplicationDetachReply)
112         err := c.conn.Invoke(ctx, in, out)
113         if err != nil {
114                 return nil, err
115         }
116         return out, nil
117 }
118
119 func (c *serviceClient) ApplicationTLSCertAdd(ctx context.Context, in *ApplicationTLSCertAdd) (*ApplicationTLSCertAddReply, error) {
120         out := new(ApplicationTLSCertAddReply)
121         err := c.conn.Invoke(ctx, in, out)
122         if err != nil {
123                 return nil, err
124         }
125         return out, nil
126 }
127
128 func (c *serviceClient) ApplicationTLSKeyAdd(ctx context.Context, in *ApplicationTLSKeyAdd) (*ApplicationTLSKeyAddReply, error) {
129         out := new(ApplicationTLSKeyAddReply)
130         err := c.conn.Invoke(ctx, in, out)
131         if err != nil {
132                 return nil, err
133         }
134         return out, nil
135 }
136
137 func (c *serviceClient) BindSock(ctx context.Context, in *BindSock) (*BindSockReply, error) {
138         out := new(BindSockReply)
139         err := c.conn.Invoke(ctx, in, out)
140         if err != nil {
141                 return nil, err
142         }
143         return out, nil
144 }
145
146 func (c *serviceClient) BindURI(ctx context.Context, in *BindURI) (*BindURIReply, error) {
147         out := new(BindURIReply)
148         err := c.conn.Invoke(ctx, in, out)
149         if err != nil {
150                 return nil, err
151         }
152         return out, nil
153 }
154
155 func (c *serviceClient) ConnectSock(ctx context.Context, in *ConnectSock) (*ConnectSockReply, error) {
156         out := new(ConnectSockReply)
157         err := c.conn.Invoke(ctx, in, out)
158         if err != nil {
159                 return nil, err
160         }
161         return out, nil
162 }
163
164 func (c *serviceClient) ConnectURI(ctx context.Context, in *ConnectURI) (*ConnectURIReply, error) {
165         out := new(ConnectURIReply)
166         err := c.conn.Invoke(ctx, in, out)
167         if err != nil {
168                 return nil, err
169         }
170         return out, nil
171 }
172
173 func (c *serviceClient) DisconnectSession(ctx context.Context, in *DisconnectSession) (*DisconnectSessionReply, error) {
174         out := new(DisconnectSessionReply)
175         err := c.conn.Invoke(ctx, in, out)
176         if err != nil {
177                 return nil, err
178         }
179         return out, nil
180 }
181
182 func (c *serviceClient) MapAnotherSegment(ctx context.Context, in *MapAnotherSegment) (*MapAnotherSegmentReply, error) {
183         out := new(MapAnotherSegmentReply)
184         err := c.conn.Invoke(ctx, in, out)
185         if err != nil {
186                 return nil, err
187         }
188         return out, nil
189 }
190
191 func (c *serviceClient) SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error) {
192         out := new(SessionEnableDisableReply)
193         err := c.conn.Invoke(ctx, in, out)
194         if err != nil {
195                 return nil, err
196         }
197         return out, nil
198 }
199
200 func (c *serviceClient) SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error) {
201         out := new(SessionRuleAddDelReply)
202         err := c.conn.Invoke(ctx, in, out)
203         if err != nil {
204                 return nil, err
205         }
206         return out, nil
207 }
208
209 func (c *serviceClient) SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error) {
210         stream, err := c.conn.NewStream(ctx)
211         if err != nil {
212                 return nil, err
213         }
214         x := &serviceClient_SessionRulesDumpClient{stream}
215         if err := x.Stream.SendMsg(in); err != nil {
216                 return nil, err
217         }
218         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
219                 return nil, err
220         }
221         return x, nil
222 }
223
224 type RPCService_SessionRulesDumpClient interface {
225         Recv() (*SessionRulesDetails, error)
226         api.Stream
227 }
228
229 type serviceClient_SessionRulesDumpClient struct {
230         api.Stream
231 }
232
233 func (c *serviceClient_SessionRulesDumpClient) Recv() (*SessionRulesDetails, error) {
234         msg, err := c.Stream.RecvMsg()
235         if err != nil {
236                 return nil, err
237         }
238         switch m := msg.(type) {
239         case *SessionRulesDetails:
240                 return m, nil
241         case *vpe.ControlPingReply:
242                 return nil, io.EOF
243         default:
244                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
245         }
246 }
247
248 func (c *serviceClient) UnbindSock(ctx context.Context, in *UnbindSock) (*UnbindSockReply, error) {
249         out := new(UnbindSockReply)
250         err := c.conn.Invoke(ctx, in, out)
251         if err != nil {
252                 return nil, err
253         }
254         return out, nil
255 }
256
257 func (c *serviceClient) UnbindURI(ctx context.Context, in *UnbindURI) (*UnbindURIReply, error) {
258         out := new(UnbindURIReply)
259         err := c.conn.Invoke(ctx, in, out)
260         if err != nil {
261                 return nil, err
262         }
263         return out, nil
264 }
265
266 func (c *serviceClient) UnmapSegment(ctx context.Context, in *UnmapSegment) (*UnmapSegmentReply, error) {
267         out := new(UnmapSegmentReply)
268         err := c.conn.Invoke(ctx, in, out)
269         if err != nil {
270                 return nil, err
271         }
272         return out, nil
273 }