Change module name to go.fd.io/govpp
[govpp.git] / binapi / lcp / lcp_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package lcp
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "go.fd.io/govpp/api"
11 )
12
13 // RPCService defines RPC service lcp.
14 type RPCService interface {
15         LcpDefaultNsGet(ctx context.Context, in *LcpDefaultNsGet) (*LcpDefaultNsGetReply, error)
16         LcpDefaultNsSet(ctx context.Context, in *LcpDefaultNsSet) (*LcpDefaultNsSetReply, error)
17         LcpItfPairAddDel(ctx context.Context, in *LcpItfPairAddDel) (*LcpItfPairAddDelReply, error)
18         LcpItfPairAddDelV2(ctx context.Context, in *LcpItfPairAddDelV2) (*LcpItfPairAddDelV2Reply, error)
19         LcpItfPairGet(ctx context.Context, in *LcpItfPairGet) (RPCService_LcpItfPairGetClient, error)
20         LcpItfPairReplaceBegin(ctx context.Context, in *LcpItfPairReplaceBegin) (*LcpItfPairReplaceBeginReply, error)
21         LcpItfPairReplaceEnd(ctx context.Context, in *LcpItfPairReplaceEnd) (*LcpItfPairReplaceEndReply, error)
22 }
23
24 type serviceClient struct {
25         conn api.Connection
26 }
27
28 func NewServiceClient(conn api.Connection) RPCService {
29         return &serviceClient{conn}
30 }
31
32 func (c *serviceClient) LcpDefaultNsGet(ctx context.Context, in *LcpDefaultNsGet) (*LcpDefaultNsGetReply, error) {
33         out := new(LcpDefaultNsGetReply)
34         err := c.conn.Invoke(ctx, in, out)
35         if err != nil {
36                 return nil, err
37         }
38         return out, nil
39 }
40
41 func (c *serviceClient) LcpDefaultNsSet(ctx context.Context, in *LcpDefaultNsSet) (*LcpDefaultNsSetReply, error) {
42         out := new(LcpDefaultNsSetReply)
43         err := c.conn.Invoke(ctx, in, out)
44         if err != nil {
45                 return nil, err
46         }
47         return out, api.RetvalToVPPApiError(out.Retval)
48 }
49
50 func (c *serviceClient) LcpItfPairAddDel(ctx context.Context, in *LcpItfPairAddDel) (*LcpItfPairAddDelReply, error) {
51         out := new(LcpItfPairAddDelReply)
52         err := c.conn.Invoke(ctx, in, out)
53         if err != nil {
54                 return nil, err
55         }
56         return out, api.RetvalToVPPApiError(out.Retval)
57 }
58
59 func (c *serviceClient) LcpItfPairAddDelV2(ctx context.Context, in *LcpItfPairAddDelV2) (*LcpItfPairAddDelV2Reply, error) {
60         out := new(LcpItfPairAddDelV2Reply)
61         err := c.conn.Invoke(ctx, in, out)
62         if err != nil {
63                 return nil, err
64         }
65         return out, api.RetvalToVPPApiError(out.Retval)
66 }
67
68 func (c *serviceClient) LcpItfPairGet(ctx context.Context, in *LcpItfPairGet) (RPCService_LcpItfPairGetClient, error) {
69         stream, err := c.conn.NewStream(ctx)
70         if err != nil {
71                 return nil, err
72         }
73         x := &serviceClient_LcpItfPairGetClient{stream}
74         if err := x.Stream.SendMsg(in); err != nil {
75                 return nil, err
76         }
77         return x, nil
78 }
79
80 type RPCService_LcpItfPairGetClient interface {
81         Recv() (*LcpItfPairDetails, error)
82         api.Stream
83 }
84
85 type serviceClient_LcpItfPairGetClient struct {
86         api.Stream
87 }
88
89 func (c *serviceClient_LcpItfPairGetClient) Recv() (*LcpItfPairDetails, error) {
90         msg, err := c.Stream.RecvMsg()
91         if err != nil {
92                 return nil, err
93         }
94         switch m := msg.(type) {
95         case *LcpItfPairDetails:
96                 return m, nil
97         case *LcpItfPairGetReply:
98                 err = c.Stream.Close()
99                 if err != nil {
100                         return nil, err
101                 }
102                 return nil, io.EOF
103         default:
104                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
105         }
106 }
107
108 func (c *serviceClient) LcpItfPairReplaceBegin(ctx context.Context, in *LcpItfPairReplaceBegin) (*LcpItfPairReplaceBeginReply, error) {
109         out := new(LcpItfPairReplaceBeginReply)
110         err := c.conn.Invoke(ctx, in, out)
111         if err != nil {
112                 return nil, err
113         }
114         return out, api.RetvalToVPPApiError(out.Retval)
115 }
116
117 func (c *serviceClient) LcpItfPairReplaceEnd(ctx context.Context, in *LcpItfPairReplaceEnd) (*LcpItfPairReplaceEndReply, error) {
118         out := new(LcpItfPairReplaceEndReply)
119         err := c.conn.Invoke(ctx, in, out)
120         if err != nil {
121                 return nil, err
122         }
123         return out, api.RetvalToVPPApiError(out.Retval)
124 }