b295bad1507a86e698cf0c4debcd08fa543a20f4
[govpp.git] / binapi / bfd / bfd_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package bfd
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "git.fd.io/govpp.git/api"
11         memclnt "git.fd.io/govpp.git/binapi/memclnt"
12 )
13
14 // RPCService defines RPC service bfd.
15 type RPCService interface {
16         BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error)
17         BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error)
18         BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error)
19         BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error)
20         BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error)
21         BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error)
22         BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error)
23         BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error)
24         BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error)
25         BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error)
26         BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error)
27         BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error)
28         BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error)
29         WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, 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) BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error) {
41         out := new(BfdAuthDelKeyReply)
42         err := c.conn.Invoke(ctx, in, out)
43         if err != nil {
44                 return nil, err
45         }
46         return out, api.RetvalToVPPApiError(out.Retval)
47 }
48
49 func (c *serviceClient) BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error) {
50         stream, err := c.conn.NewStream(ctx)
51         if err != nil {
52                 return nil, err
53         }
54         x := &serviceClient_BfdAuthKeysDumpClient{stream}
55         if err := x.Stream.SendMsg(in); err != nil {
56                 return nil, err
57         }
58         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
59                 return nil, err
60         }
61         return x, nil
62 }
63
64 type RPCService_BfdAuthKeysDumpClient interface {
65         Recv() (*BfdAuthKeysDetails, error)
66         api.Stream
67 }
68
69 type serviceClient_BfdAuthKeysDumpClient struct {
70         api.Stream
71 }
72
73 func (c *serviceClient_BfdAuthKeysDumpClient) Recv() (*BfdAuthKeysDetails, error) {
74         msg, err := c.Stream.RecvMsg()
75         if err != nil {
76                 return nil, err
77         }
78         switch m := msg.(type) {
79         case *BfdAuthKeysDetails:
80                 return m, nil
81         case *memclnt.ControlPingReply:
82                 err = c.Stream.Close()
83                 if err != nil {
84                         return nil, err
85                 }
86                 return nil, io.EOF
87         default:
88                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
89         }
90 }
91
92 func (c *serviceClient) BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error) {
93         out := new(BfdAuthSetKeyReply)
94         err := c.conn.Invoke(ctx, in, out)
95         if err != nil {
96                 return nil, err
97         }
98         return out, api.RetvalToVPPApiError(out.Retval)
99 }
100
101 func (c *serviceClient) BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error) {
102         out := new(BfdUDPAddReply)
103         err := c.conn.Invoke(ctx, in, out)
104         if err != nil {
105                 return nil, err
106         }
107         return out, api.RetvalToVPPApiError(out.Retval)
108 }
109
110 func (c *serviceClient) BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error) {
111         out := new(BfdUDPAuthActivateReply)
112         err := c.conn.Invoke(ctx, in, out)
113         if err != nil {
114                 return nil, err
115         }
116         return out, api.RetvalToVPPApiError(out.Retval)
117 }
118
119 func (c *serviceClient) BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error) {
120         out := new(BfdUDPAuthDeactivateReply)
121         err := c.conn.Invoke(ctx, in, out)
122         if err != nil {
123                 return nil, err
124         }
125         return out, api.RetvalToVPPApiError(out.Retval)
126 }
127
128 func (c *serviceClient) BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error) {
129         out := new(BfdUDPDelReply)
130         err := c.conn.Invoke(ctx, in, out)
131         if err != nil {
132                 return nil, err
133         }
134         return out, api.RetvalToVPPApiError(out.Retval)
135 }
136
137 func (c *serviceClient) BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error) {
138         out := new(BfdUDPDelEchoSourceReply)
139         err := c.conn.Invoke(ctx, in, out)
140         if err != nil {
141                 return nil, err
142         }
143         return out, api.RetvalToVPPApiError(out.Retval)
144 }
145
146 func (c *serviceClient) BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error) {
147         out := new(BfdUDPGetEchoSourceReply)
148         err := c.conn.Invoke(ctx, in, out)
149         if err != nil {
150                 return nil, err
151         }
152         return out, api.RetvalToVPPApiError(out.Retval)
153 }
154
155 func (c *serviceClient) BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error) {
156         out := new(BfdUDPModReply)
157         err := c.conn.Invoke(ctx, in, out)
158         if err != nil {
159                 return nil, err
160         }
161         return out, api.RetvalToVPPApiError(out.Retval)
162 }
163
164 func (c *serviceClient) BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error) {
165         stream, err := c.conn.NewStream(ctx)
166         if err != nil {
167                 return nil, err
168         }
169         x := &serviceClient_BfdUDPSessionDumpClient{stream}
170         if err := x.Stream.SendMsg(in); err != nil {
171                 return nil, err
172         }
173         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
174                 return nil, err
175         }
176         return x, nil
177 }
178
179 type RPCService_BfdUDPSessionDumpClient interface {
180         Recv() (*BfdUDPSessionDetails, error)
181         api.Stream
182 }
183
184 type serviceClient_BfdUDPSessionDumpClient struct {
185         api.Stream
186 }
187
188 func (c *serviceClient_BfdUDPSessionDumpClient) Recv() (*BfdUDPSessionDetails, error) {
189         msg, err := c.Stream.RecvMsg()
190         if err != nil {
191                 return nil, err
192         }
193         switch m := msg.(type) {
194         case *BfdUDPSessionDetails:
195                 return m, nil
196         case *memclnt.ControlPingReply:
197                 err = c.Stream.Close()
198                 if err != nil {
199                         return nil, err
200                 }
201                 return nil, io.EOF
202         default:
203                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
204         }
205 }
206
207 func (c *serviceClient) BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error) {
208         out := new(BfdUDPSessionSetFlagsReply)
209         err := c.conn.Invoke(ctx, in, out)
210         if err != nil {
211                 return nil, err
212         }
213         return out, api.RetvalToVPPApiError(out.Retval)
214 }
215
216 func (c *serviceClient) BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error) {
217         out := new(BfdUDPSetEchoSourceReply)
218         err := c.conn.Invoke(ctx, in, out)
219         if err != nil {
220                 return nil, err
221         }
222         return out, api.RetvalToVPPApiError(out.Retval)
223 }
224
225 func (c *serviceClient) WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, error) {
226         out := new(WantBfdEventsReply)
227         err := c.conn.Invoke(ctx, in, out)
228         if err != nil {
229                 return nil, err
230         }
231         return out, api.RetvalToVPPApiError(out.Retval)
232 }