github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/lisp_gpe/lisp_gpe_rpc.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 package lisp_gpe 4 5 import ( 6 "context" 7 "fmt" 8 "io" 9 10 memclnt "github.com/networkservicemesh/govpp/binapi/memclnt" 11 api "go.fd.io/govpp/api" 12 ) 13 14 // RPCService defines RPC service lisp_gpe. 15 type RPCService interface { 16 GpeAddDelFwdEntry(ctx context.Context, in *GpeAddDelFwdEntry) (*GpeAddDelFwdEntryReply, error) 17 GpeAddDelIface(ctx context.Context, in *GpeAddDelIface) (*GpeAddDelIfaceReply, error) 18 GpeAddDelNativeFwdRpath(ctx context.Context, in *GpeAddDelNativeFwdRpath) (*GpeAddDelNativeFwdRpathReply, error) 19 GpeEnableDisable(ctx context.Context, in *GpeEnableDisable) (*GpeEnableDisableReply, error) 20 GpeFwdEntriesGet(ctx context.Context, in *GpeFwdEntriesGet) (*GpeFwdEntriesGetReply, error) 21 GpeFwdEntryPathDump(ctx context.Context, in *GpeFwdEntryPathDump) (RPCService_GpeFwdEntryPathDumpClient, error) 22 GpeFwdEntryVnisGet(ctx context.Context, in *GpeFwdEntryVnisGet) (*GpeFwdEntryVnisGetReply, error) 23 GpeGetEncapMode(ctx context.Context, in *GpeGetEncapMode) (*GpeGetEncapModeReply, error) 24 GpeNativeFwdRpathsGet(ctx context.Context, in *GpeNativeFwdRpathsGet) (*GpeNativeFwdRpathsGetReply, error) 25 GpeSetEncapMode(ctx context.Context, in *GpeSetEncapMode) (*GpeSetEncapModeReply, error) 26 } 27 28 type serviceClient struct { 29 conn api.Connection 30 } 31 32 func NewServiceClient(conn api.Connection) RPCService { 33 return &serviceClient{conn} 34 } 35 36 func (c *serviceClient) GpeAddDelFwdEntry(ctx context.Context, in *GpeAddDelFwdEntry) (*GpeAddDelFwdEntryReply, error) { 37 out := new(GpeAddDelFwdEntryReply) 38 err := c.conn.Invoke(ctx, in, out) 39 if err != nil { 40 return nil, err 41 } 42 return out, api.RetvalToVPPApiError(out.Retval) 43 } 44 45 func (c *serviceClient) GpeAddDelIface(ctx context.Context, in *GpeAddDelIface) (*GpeAddDelIfaceReply, error) { 46 out := new(GpeAddDelIfaceReply) 47 err := c.conn.Invoke(ctx, in, out) 48 if err != nil { 49 return nil, err 50 } 51 return out, api.RetvalToVPPApiError(out.Retval) 52 } 53 54 func (c *serviceClient) GpeAddDelNativeFwdRpath(ctx context.Context, in *GpeAddDelNativeFwdRpath) (*GpeAddDelNativeFwdRpathReply, error) { 55 out := new(GpeAddDelNativeFwdRpathReply) 56 err := c.conn.Invoke(ctx, in, out) 57 if err != nil { 58 return nil, err 59 } 60 return out, api.RetvalToVPPApiError(out.Retval) 61 } 62 63 func (c *serviceClient) GpeEnableDisable(ctx context.Context, in *GpeEnableDisable) (*GpeEnableDisableReply, error) { 64 out := new(GpeEnableDisableReply) 65 err := c.conn.Invoke(ctx, in, out) 66 if err != nil { 67 return nil, err 68 } 69 return out, api.RetvalToVPPApiError(out.Retval) 70 } 71 72 func (c *serviceClient) GpeFwdEntriesGet(ctx context.Context, in *GpeFwdEntriesGet) (*GpeFwdEntriesGetReply, error) { 73 out := new(GpeFwdEntriesGetReply) 74 err := c.conn.Invoke(ctx, in, out) 75 if err != nil { 76 return nil, err 77 } 78 return out, api.RetvalToVPPApiError(out.Retval) 79 } 80 81 func (c *serviceClient) GpeFwdEntryPathDump(ctx context.Context, in *GpeFwdEntryPathDump) (RPCService_GpeFwdEntryPathDumpClient, error) { 82 stream, err := c.conn.NewStream(ctx) 83 if err != nil { 84 return nil, err 85 } 86 x := &serviceClient_GpeFwdEntryPathDumpClient{stream} 87 if err := x.Stream.SendMsg(in); err != nil { 88 return nil, err 89 } 90 if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { 91 return nil, err 92 } 93 return x, nil 94 } 95 96 type RPCService_GpeFwdEntryPathDumpClient interface { 97 Recv() (*GpeFwdEntryPathDetails, error) 98 api.Stream 99 } 100 101 type serviceClient_GpeFwdEntryPathDumpClient struct { 102 api.Stream 103 } 104 105 func (c *serviceClient_GpeFwdEntryPathDumpClient) Recv() (*GpeFwdEntryPathDetails, error) { 106 msg, err := c.Stream.RecvMsg() 107 if err != nil { 108 return nil, err 109 } 110 switch m := msg.(type) { 111 case *GpeFwdEntryPathDetails: 112 return m, nil 113 case *memclnt.ControlPingReply: 114 err = c.Stream.Close() 115 if err != nil { 116 return nil, err 117 } 118 return nil, io.EOF 119 default: 120 return nil, fmt.Errorf("unexpected message: %T %v", m, m) 121 } 122 } 123 124 func (c *serviceClient) GpeFwdEntryVnisGet(ctx context.Context, in *GpeFwdEntryVnisGet) (*GpeFwdEntryVnisGetReply, error) { 125 out := new(GpeFwdEntryVnisGetReply) 126 err := c.conn.Invoke(ctx, in, out) 127 if err != nil { 128 return nil, err 129 } 130 return out, api.RetvalToVPPApiError(out.Retval) 131 } 132 133 func (c *serviceClient) GpeGetEncapMode(ctx context.Context, in *GpeGetEncapMode) (*GpeGetEncapModeReply, error) { 134 out := new(GpeGetEncapModeReply) 135 err := c.conn.Invoke(ctx, in, out) 136 if err != nil { 137 return nil, err 138 } 139 return out, api.RetvalToVPPApiError(out.Retval) 140 } 141 142 func (c *serviceClient) GpeNativeFwdRpathsGet(ctx context.Context, in *GpeNativeFwdRpathsGet) (*GpeNativeFwdRpathsGetReply, error) { 143 out := new(GpeNativeFwdRpathsGetReply) 144 err := c.conn.Invoke(ctx, in, out) 145 if err != nil { 146 return nil, err 147 } 148 return out, api.RetvalToVPPApiError(out.Retval) 149 } 150 151 func (c *serviceClient) GpeSetEncapMode(ctx context.Context, in *GpeSetEncapMode) (*GpeSetEncapModeReply, error) { 152 out := new(GpeSetEncapModeReply) 153 err := c.conn.Invoke(ctx, in, out) 154 if err != nil { 155 return nil, err 156 } 157 return out, api.RetvalToVPPApiError(out.Retval) 158 }