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 vhost_user.
15 type RPCService interface {
16 CreateVhostUserIf(ctx context.Context, in *CreateVhostUserIf) (*CreateVhostUserIfReply, error)
17 DeleteVhostUserIf(ctx context.Context, in *DeleteVhostUserIf) (*DeleteVhostUserIfReply, error)
18 ModifyVhostUserIf(ctx context.Context, in *ModifyVhostUserIf) (*ModifyVhostUserIfReply, error)
19 SwInterfaceVhostUserDump(ctx context.Context, in *SwInterfaceVhostUserDump) (RPCService_SwInterfaceVhostUserDumpClient, error)
22 type serviceClient struct {
26 func NewServiceClient(conn api.Connection) RPCService {
27 return &serviceClient{conn}
30 func (c *serviceClient) CreateVhostUserIf(ctx context.Context, in *CreateVhostUserIf) (*CreateVhostUserIfReply, error) {
31 out := new(CreateVhostUserIfReply)
32 err := c.conn.Invoke(ctx, in, out)
36 return out, api.RetvalToVPPApiError(out.Retval)
39 func (c *serviceClient) DeleteVhostUserIf(ctx context.Context, in *DeleteVhostUserIf) (*DeleteVhostUserIfReply, error) {
40 out := new(DeleteVhostUserIfReply)
41 err := c.conn.Invoke(ctx, in, out)
45 return out, api.RetvalToVPPApiError(out.Retval)
48 func (c *serviceClient) ModifyVhostUserIf(ctx context.Context, in *ModifyVhostUserIf) (*ModifyVhostUserIfReply, error) {
49 out := new(ModifyVhostUserIfReply)
50 err := c.conn.Invoke(ctx, in, out)
54 return out, api.RetvalToVPPApiError(out.Retval)
57 func (c *serviceClient) SwInterfaceVhostUserDump(ctx context.Context, in *SwInterfaceVhostUserDump) (RPCService_SwInterfaceVhostUserDumpClient, error) {
58 stream, err := c.conn.NewStream(ctx)
62 x := &serviceClient_SwInterfaceVhostUserDumpClient{stream}
63 if err := x.Stream.SendMsg(in); err != nil {
66 if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
72 type RPCService_SwInterfaceVhostUserDumpClient interface {
73 Recv() (*SwInterfaceVhostUserDetails, error)
77 type serviceClient_SwInterfaceVhostUserDumpClient struct {
81 func (c *serviceClient_SwInterfaceVhostUserDumpClient) Recv() (*SwInterfaceVhostUserDetails, error) {
82 msg, err := c.Stream.RecvMsg()
86 switch m := msg.(type) {
87 case *SwInterfaceVhostUserDetails:
89 case *vpe.ControlPingReply:
90 err = c.Stream.Close()
96 return nil, fmt.Errorf("unexpected message: %T %v", m, m)