1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
10 api "go.fd.io/govpp/api"
11 memclnt "go.fd.io/govpp/binapi/memclnt"
14 // RPCService defines RPC service memif.
15 type RPCService interface {
16 MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error)
17 MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error)
18 MemifDump(ctx context.Context, in *MemifDump) (RPCService_MemifDumpClient, error)
19 MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
20 MemifSocketFilenameDump(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_MemifSocketFilenameDumpClient, error)
23 type serviceClient struct {
27 func NewServiceClient(conn api.Connection) RPCService {
28 return &serviceClient{conn}
31 func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
32 out := new(MemifCreateReply)
33 err := c.conn.Invoke(ctx, in, out)
37 return out, api.RetvalToVPPApiError(out.Retval)
40 func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
41 out := new(MemifDeleteReply)
42 err := c.conn.Invoke(ctx, in, out)
46 return out, api.RetvalToVPPApiError(out.Retval)
49 func (c *serviceClient) MemifDump(ctx context.Context, in *MemifDump) (RPCService_MemifDumpClient, error) {
50 stream, err := c.conn.NewStream(ctx)
54 x := &serviceClient_MemifDumpClient{stream}
55 if err := x.Stream.SendMsg(in); err != nil {
58 if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
64 type RPCService_MemifDumpClient interface {
65 Recv() (*MemifDetails, error)
69 type serviceClient_MemifDumpClient struct {
73 func (c *serviceClient_MemifDumpClient) Recv() (*MemifDetails, error) {
74 msg, err := c.Stream.RecvMsg()
78 switch m := msg.(type) {
81 case *memclnt.ControlPingReply:
82 err = c.Stream.Close()
88 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
92 func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
93 out := new(MemifSocketFilenameAddDelReply)
94 err := c.conn.Invoke(ctx, in, out)
98 return out, api.RetvalToVPPApiError(out.Retval)
101 func (c *serviceClient) MemifSocketFilenameDump(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_MemifSocketFilenameDumpClient, error) {
102 stream, err := c.conn.NewStream(ctx)
106 x := &serviceClient_MemifSocketFilenameDumpClient{stream}
107 if err := x.Stream.SendMsg(in); err != nil {
110 if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
116 type RPCService_MemifSocketFilenameDumpClient interface {
117 Recv() (*MemifSocketFilenameDetails, error)
121 type serviceClient_MemifSocketFilenameDumpClient struct {
125 func (c *serviceClient_MemifSocketFilenameDumpClient) Recv() (*MemifSocketFilenameDetails, error) {
126 msg, err := c.Stream.RecvMsg()
130 switch m := msg.(type) {
131 case *MemifSocketFilenameDetails:
133 case *memclnt.ControlPingReply:
134 err = c.Stream.Close()
140 return nil, fmt.Errorf("unexpected message: %T %v", m, m)