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/binapi/vpe"
14 // RPCService defines RPC service nsh.
15 type RPCService interface {
16 NshAddDelEntry(ctx context.Context, in *NshAddDelEntry) (*NshAddDelEntryReply, error)
17 NshAddDelMap(ctx context.Context, in *NshAddDelMap) (*NshAddDelMapReply, error)
18 NshEntryDump(ctx context.Context, in *NshEntryDump) (RPCService_NshEntryDumpClient, error)
19 NshMapDump(ctx context.Context, in *NshMapDump) (RPCService_NshMapDumpClient, error)
22 type serviceClient struct {
26 func NewServiceClient(conn api.Connection) RPCService {
27 return &serviceClient{conn}
30 func (c *serviceClient) NshAddDelEntry(ctx context.Context, in *NshAddDelEntry) (*NshAddDelEntryReply, error) {
31 out := new(NshAddDelEntryReply)
32 err := c.conn.Invoke(ctx, in, out)
36 return out, api.RetvalToVPPApiError(out.Retval)
39 func (c *serviceClient) NshAddDelMap(ctx context.Context, in *NshAddDelMap) (*NshAddDelMapReply, error) {
40 out := new(NshAddDelMapReply)
41 err := c.conn.Invoke(ctx, in, out)
45 return out, api.RetvalToVPPApiError(out.Retval)
48 func (c *serviceClient) NshEntryDump(ctx context.Context, in *NshEntryDump) (RPCService_NshEntryDumpClient, error) {
49 stream, err := c.conn.NewStream(ctx)
53 x := &serviceClient_NshEntryDumpClient{stream}
54 if err := x.Stream.SendMsg(in); err != nil {
57 if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
63 type RPCService_NshEntryDumpClient interface {
64 Recv() (*NshEntryDetails, error)
68 type serviceClient_NshEntryDumpClient struct {
72 func (c *serviceClient_NshEntryDumpClient) Recv() (*NshEntryDetails, error) {
73 msg, err := c.Stream.RecvMsg()
77 switch m := msg.(type) {
78 case *NshEntryDetails:
80 case *vpe.ControlPingReply:
83 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
87 func (c *serviceClient) NshMapDump(ctx context.Context, in *NshMapDump) (RPCService_NshMapDumpClient, error) {
88 stream, err := c.conn.NewStream(ctx)
92 x := &serviceClient_NshMapDumpClient{stream}
93 if err := x.Stream.SendMsg(in); err != nil {
96 if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
102 type RPCService_NshMapDumpClient interface {
103 Recv() (*NshMapDetails, error)
107 type serviceClient_NshMapDumpClient struct {
111 func (c *serviceClient_NshMapDumpClient) Recv() (*NshMapDetails, error) {
112 msg, err := c.Stream.RecvMsg()
116 switch m := msg.(type) {
119 case *vpe.ControlPingReply:
122 return nil, fmt.Errorf("unexpected message: %T %v", m, m)