go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2106/vpe/vpe_rpc.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 package vpe 4 5 import ( 6 "context" 7 "fmt" 8 "io" 9 10 api "go.fd.io/govpp/api" 11 ) 12 13 // RPCService defines RPC service vpe. 14 type RPCService interface { 15 AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error) 16 Cli(ctx context.Context, in *Cli) (*CliReply, error) 17 CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error) 18 ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) 19 GetF64EndianValue(ctx context.Context, in *GetF64EndianValue) (*GetF64EndianValueReply, error) 20 GetF64IncrementByOne(ctx context.Context, in *GetF64IncrementByOne) (*GetF64IncrementByOneReply, error) 21 GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error) 22 GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error) 23 GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error) 24 LogDump(ctx context.Context, in *LogDump) (RPCService_LogDumpClient, error) 25 ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error) 26 ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error) 27 ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error) 28 } 29 30 type serviceClient struct { 31 conn api.Connection 32 } 33 34 func NewServiceClient(conn api.Connection) RPCService { 35 return &serviceClient{conn} 36 } 37 38 func (c *serviceClient) AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error) { 39 out := new(AddNodeNextReply) 40 err := c.conn.Invoke(ctx, in, out) 41 if err != nil { 42 return nil, err 43 } 44 return out, api.RetvalToVPPApiError(out.Retval) 45 } 46 47 func (c *serviceClient) Cli(ctx context.Context, in *Cli) (*CliReply, error) { 48 out := new(CliReply) 49 err := c.conn.Invoke(ctx, in, out) 50 if err != nil { 51 return nil, err 52 } 53 return out, api.RetvalToVPPApiError(out.Retval) 54 } 55 56 func (c *serviceClient) CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error) { 57 out := new(CliInbandReply) 58 err := c.conn.Invoke(ctx, in, out) 59 if err != nil { 60 return nil, err 61 } 62 return out, api.RetvalToVPPApiError(out.Retval) 63 } 64 65 func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) { 66 out := new(ControlPingReply) 67 err := c.conn.Invoke(ctx, in, out) 68 if err != nil { 69 return nil, err 70 } 71 return out, api.RetvalToVPPApiError(out.Retval) 72 } 73 74 func (c *serviceClient) GetF64EndianValue(ctx context.Context, in *GetF64EndianValue) (*GetF64EndianValueReply, error) { 75 out := new(GetF64EndianValueReply) 76 err := c.conn.Invoke(ctx, in, out) 77 if err != nil { 78 return nil, err 79 } 80 return out, api.RetvalToVPPApiError(int32(out.Retval)) 81 } 82 83 func (c *serviceClient) GetF64IncrementByOne(ctx context.Context, in *GetF64IncrementByOne) (*GetF64IncrementByOneReply, error) { 84 out := new(GetF64IncrementByOneReply) 85 err := c.conn.Invoke(ctx, in, out) 86 if err != nil { 87 return nil, err 88 } 89 return out, api.RetvalToVPPApiError(int32(out.Retval)) 90 } 91 92 func (c *serviceClient) GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error) { 93 out := new(GetNextIndexReply) 94 err := c.conn.Invoke(ctx, in, out) 95 if err != nil { 96 return nil, err 97 } 98 return out, api.RetvalToVPPApiError(out.Retval) 99 } 100 101 func (c *serviceClient) GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error) { 102 out := new(GetNodeGraphReply) 103 err := c.conn.Invoke(ctx, in, out) 104 if err != nil { 105 return nil, err 106 } 107 return out, api.RetvalToVPPApiError(out.Retval) 108 } 109 110 func (c *serviceClient) GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error) { 111 out := new(GetNodeIndexReply) 112 err := c.conn.Invoke(ctx, in, out) 113 if err != nil { 114 return nil, err 115 } 116 return out, api.RetvalToVPPApiError(out.Retval) 117 } 118 119 func (c *serviceClient) LogDump(ctx context.Context, in *LogDump) (RPCService_LogDumpClient, error) { 120 stream, err := c.conn.NewStream(ctx) 121 if err != nil { 122 return nil, err 123 } 124 x := &serviceClient_LogDumpClient{stream} 125 if err := x.Stream.SendMsg(in); err != nil { 126 return nil, err 127 } 128 if err = x.Stream.SendMsg(&ControlPing{}); err != nil { 129 return nil, err 130 } 131 return x, nil 132 } 133 134 type RPCService_LogDumpClient interface { 135 Recv() (*LogDetails, error) 136 api.Stream 137 } 138 139 type serviceClient_LogDumpClient struct { 140 api.Stream 141 } 142 143 func (c *serviceClient_LogDumpClient) Recv() (*LogDetails, error) { 144 msg, err := c.Stream.RecvMsg() 145 if err != nil { 146 return nil, err 147 } 148 switch m := msg.(type) { 149 case *LogDetails: 150 return m, nil 151 case *ControlPingReply: 152 err = c.Stream.Close() 153 if err != nil { 154 return nil, err 155 } 156 return nil, io.EOF 157 default: 158 return nil, fmt.Errorf("unexpected message: %T %v", m, m) 159 } 160 } 161 162 func (c *serviceClient) ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error) { 163 out := new(ShowThreadsReply) 164 err := c.conn.Invoke(ctx, in, out) 165 if err != nil { 166 return nil, err 167 } 168 return out, api.RetvalToVPPApiError(out.Retval) 169 } 170 171 func (c *serviceClient) ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error) { 172 out := new(ShowVersionReply) 173 err := c.conn.Invoke(ctx, in, out) 174 if err != nil { 175 return nil, err 176 } 177 return out, api.RetvalToVPPApiError(out.Retval) 178 } 179 180 func (c *serviceClient) ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error) { 181 out := new(ShowVpeSystemTimeReply) 182 err := c.conn.Invoke(ctx, in, out) 183 if err != nil { 184 return nil, err 185 } 186 return out, api.RetvalToVPPApiError(out.Retval) 187 }