lnd/lnrpc/devrpc/dev_grpc.pb.go
Andras Banki-Horvath 1a8f094503
lnrpc: add the devrpc development only subserver + devrpc.ImportGraph
This commits adds the devrpc package which implements a subserver that
adds clean separation for RPC calls useful for development and
debugging. This subserver is only compiled in if the dev tag is set.
Furthermore the commit adds the devrpc.ImportGraph call which can
import a graph dump obtained from another node by calling DescribeGraph.
Since the graph dump does not include the auth proofs, the imported
channels will be considered private.
2022-01-24 17:42:59 +01:00

108 lines
3.6 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package devrpc
import (
context "context"
lnrpc "github.com/lightningnetwork/lnd/lnrpc"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// DevClient is the client API for Dev service.
//
// 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 DevClient interface {
// lncli: `importgraph`
//ImportGraph imports a ChannelGraph into the graph database. Should only be
//used for development.
ImportGraph(ctx context.Context, in *lnrpc.ChannelGraph, opts ...grpc.CallOption) (*ImportGraphResponse, error)
}
type devClient struct {
cc grpc.ClientConnInterface
}
func NewDevClient(cc grpc.ClientConnInterface) DevClient {
return &devClient{cc}
}
func (c *devClient) ImportGraph(ctx context.Context, in *lnrpc.ChannelGraph, opts ...grpc.CallOption) (*ImportGraphResponse, error) {
out := new(ImportGraphResponse)
err := c.cc.Invoke(ctx, "/devrpc.Dev/ImportGraph", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DevServer is the server API for Dev service.
// All implementations must embed UnimplementedDevServer
// for forward compatibility
type DevServer interface {
// lncli: `importgraph`
//ImportGraph imports a ChannelGraph into the graph database. Should only be
//used for development.
ImportGraph(context.Context, *lnrpc.ChannelGraph) (*ImportGraphResponse, error)
mustEmbedUnimplementedDevServer()
}
// UnimplementedDevServer must be embedded to have forward compatible implementations.
type UnimplementedDevServer struct {
}
func (UnimplementedDevServer) ImportGraph(context.Context, *lnrpc.ChannelGraph) (*ImportGraphResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ImportGraph not implemented")
}
func (UnimplementedDevServer) mustEmbedUnimplementedDevServer() {}
// UnsafeDevServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DevServer will
// result in compilation errors.
type UnsafeDevServer interface {
mustEmbedUnimplementedDevServer()
}
func RegisterDevServer(s grpc.ServiceRegistrar, srv DevServer) {
s.RegisterService(&Dev_ServiceDesc, srv)
}
func _Dev_ImportGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(lnrpc.ChannelGraph)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DevServer).ImportGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/devrpc.Dev/ImportGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DevServer).ImportGraph(ctx, req.(*lnrpc.ChannelGraph))
}
return interceptor(ctx, in, info, handler)
}
// Dev_ServiceDesc is the grpc.ServiceDesc for Dev service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Dev_ServiceDesc = grpc.ServiceDesc{
ServiceName: "devrpc.Dev",
HandlerType: (*DevServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ImportGraph",
Handler: _Dev_ImportGraph_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "devrpc/dev.proto",
}