mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-23 00:34:21 +01:00
cln_plugin: custommsg support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.12
|
||||
// - protoc v4.23.4
|
||||
// source: cln_plugin.proto
|
||||
|
||||
package proto
|
||||
@@ -23,6 +23,7 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ClnPluginClient interface {
|
||||
HtlcStream(ctx context.Context, opts ...grpc.CallOption) (ClnPlugin_HtlcStreamClient, error)
|
||||
CustomMsgStream(ctx context.Context, in *CustomMessageRequest, opts ...grpc.CallOption) (ClnPlugin_CustomMsgStreamClient, error)
|
||||
}
|
||||
|
||||
type clnPluginClient struct {
|
||||
@@ -64,11 +65,44 @@ func (x *clnPluginHtlcStreamClient) Recv() (*HtlcAccepted, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *clnPluginClient) CustomMsgStream(ctx context.Context, in *CustomMessageRequest, opts ...grpc.CallOption) (ClnPlugin_CustomMsgStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &ClnPlugin_ServiceDesc.Streams[1], "/ClnPlugin/CustomMsgStream", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &clnPluginCustomMsgStreamClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type ClnPlugin_CustomMsgStreamClient interface {
|
||||
Recv() (*CustomMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type clnPluginCustomMsgStreamClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *clnPluginCustomMsgStreamClient) Recv() (*CustomMessage, error) {
|
||||
m := new(CustomMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// ClnPluginServer is the server API for ClnPlugin service.
|
||||
// All implementations must embed UnimplementedClnPluginServer
|
||||
// for forward compatibility
|
||||
type ClnPluginServer interface {
|
||||
HtlcStream(ClnPlugin_HtlcStreamServer) error
|
||||
CustomMsgStream(*CustomMessageRequest, ClnPlugin_CustomMsgStreamServer) error
|
||||
mustEmbedUnimplementedClnPluginServer()
|
||||
}
|
||||
|
||||
@@ -79,6 +113,9 @@ type UnimplementedClnPluginServer struct {
|
||||
func (UnimplementedClnPluginServer) HtlcStream(ClnPlugin_HtlcStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method HtlcStream not implemented")
|
||||
}
|
||||
func (UnimplementedClnPluginServer) CustomMsgStream(*CustomMessageRequest, ClnPlugin_CustomMsgStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method CustomMsgStream not implemented")
|
||||
}
|
||||
func (UnimplementedClnPluginServer) mustEmbedUnimplementedClnPluginServer() {}
|
||||
|
||||
// UnsafeClnPluginServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -118,6 +155,27 @@ func (x *clnPluginHtlcStreamServer) Recv() (*HtlcResolution, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _ClnPlugin_CustomMsgStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(CustomMessageRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(ClnPluginServer).CustomMsgStream(m, &clnPluginCustomMsgStreamServer{stream})
|
||||
}
|
||||
|
||||
type ClnPlugin_CustomMsgStreamServer interface {
|
||||
Send(*CustomMessage) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type clnPluginCustomMsgStreamServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *clnPluginCustomMsgStreamServer) Send(m *CustomMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
// ClnPlugin_ServiceDesc is the grpc.ServiceDesc for ClnPlugin service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -132,6 +190,11 @@ var ClnPlugin_ServiceDesc = grpc.ServiceDesc{
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "CustomMsgStream",
|
||||
Handler: _ClnPlugin_CustomMsgStream_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "cln_plugin.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user