1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
10 api "git.fd.io/govpp.git/api"
11 vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
14 // RPCService defines RPC service bond.
15 type RPCService interface {
16 BondCreate(ctx context.Context, in *BondCreate) (*BondCreateReply, error)
17 BondDelete(ctx context.Context, in *BondDelete) (*BondDeleteReply, error)
18 BondDetachSlave(ctx context.Context, in *BondDetachSlave) (*BondDetachSlaveReply, error)
19 BondEnslave(ctx context.Context, in *BondEnslave) (*BondEnslaveReply, error)
20 SwInterfaceBondDump(ctx context.Context, in *SwInterfaceBondDump) (RPCService_SwInterfaceBondDumpClient, error)
21 SwInterfaceSetBondWeight(ctx context.Context, in *SwInterfaceSetBondWeight) (*SwInterfaceSetBondWeightReply, error)
22 SwInterfaceSlaveDump(ctx context.Context, in *SwInterfaceSlaveDump) (RPCService_SwInterfaceSlaveDumpClient, error)
25 type serviceClient struct {
29 func NewServiceClient(conn api.Connection) RPCService {
30 return &serviceClient{conn}
33 func (c *serviceClient) BondCreate(ctx context.Context, in *BondCreate) (*BondCreateReply, error) {
34 out := new(BondCreateReply)
35 err := c.conn.Invoke(ctx, in, out)
39 return out, api.RetvalToVPPApiError(out.Retval)
42 func (c *serviceClient) BondDelete(ctx context.Context, in *BondDelete) (*BondDeleteReply, error) {
43 out := new(BondDeleteReply)
44 err := c.conn.Invoke(ctx, in, out)
48 return out, api.RetvalToVPPApiError(out.Retval)
51 func (c *serviceClient) BondDetachSlave(ctx context.Context, in *BondDetachSlave) (*BondDetachSlaveReply, error) {
52 out := new(BondDetachSlaveReply)
53 err := c.conn.Invoke(ctx, in, out)
57 return out, api.RetvalToVPPApiError(out.Retval)
60 func (c *serviceClient) BondEnslave(ctx context.Context, in *BondEnslave) (*BondEnslaveReply, error) {
61 out := new(BondEnslaveReply)
62 err := c.conn.Invoke(ctx, in, out)
66 return out, api.RetvalToVPPApiError(out.Retval)
69 func (c *serviceClient) SwInterfaceBondDump(ctx context.Context, in *SwInterfaceBondDump) (RPCService_SwInterfaceBondDumpClient, error) {
70 stream, err := c.conn.NewStream(ctx)
74 x := &serviceClient_SwInterfaceBondDumpClient{stream}
75 if err := x.Stream.SendMsg(in); err != nil {
78 if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
84 type RPCService_SwInterfaceBondDumpClient interface {
85 Recv() (*SwInterfaceBondDetails, error)
89 type serviceClient_SwInterfaceBondDumpClient struct {
93 func (c *serviceClient_SwInterfaceBondDumpClient) Recv() (*SwInterfaceBondDetails, error) {
94 msg, err := c.Stream.RecvMsg()
98 switch m := msg.(type) {
99 case *SwInterfaceBondDetails:
101 case *vpe.ControlPingReply:
102 err = c.Stream.Close()
108 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
112 func (c *serviceClient) SwInterfaceSetBondWeight(ctx context.Context, in *SwInterfaceSetBondWeight) (*SwInterfaceSetBondWeightReply, error) {
113 out := new(SwInterfaceSetBondWeightReply)
114 err := c.conn.Invoke(ctx, in, out)
118 return out, api.RetvalToVPPApiError(out.Retval)
121 func (c *serviceClient) SwInterfaceSlaveDump(ctx context.Context, in *SwInterfaceSlaveDump) (RPCService_SwInterfaceSlaveDumpClient, error) {
122 stream, err := c.conn.NewStream(ctx)
126 x := &serviceClient_SwInterfaceSlaveDumpClient{stream}
127 if err := x.Stream.SendMsg(in); err != nil {
130 if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
136 type RPCService_SwInterfaceSlaveDumpClient interface {
137 Recv() (*SwInterfaceSlaveDetails, error)
141 type serviceClient_SwInterfaceSlaveDumpClient struct {
145 func (c *serviceClient_SwInterfaceSlaveDumpClient) Recv() (*SwInterfaceSlaveDetails, error) {
146 msg, err := c.Stream.RecvMsg()
150 switch m := msg.(type) {
151 case *SwInterfaceSlaveDetails:
153 case *vpe.ControlPingReply:
154 err = c.Stream.Close()
160 return nil, fmt.Errorf("unexpected message: %T %v", m, m)