lnd/lnrpc/devrpc/dev.pb.json.go
Elle Mouton 58317e66d3
lnrpc/Dockerfile: update falafel version
Update the falafel version.
2024-08-05 15:59:50 +02:00

50 lines
1.1 KiB
Go

// Code generated by falafel 0.9.2. DO NOT EDIT.
// source: dev.proto
package devrpc
import (
"context"
gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/lightningnetwork/lnd/lnrpc"
"google.golang.org/grpc"
"google.golang.org/protobuf/encoding/protojson"
)
func RegisterDevJSONCallbacks(registry map[string]func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error))) {
marshaler := &gateway.JSONPb{
MarshalOptions: protojson.MarshalOptions{
UseProtoNames: true,
EmitUnpopulated: true,
},
}
registry["devrpc.Dev.ImportGraph"] = func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
req := &lnrpc.ChannelGraph{}
err := marshaler.Unmarshal([]byte(reqJSON), req)
if err != nil {
callback("", err)
return
}
client := NewDevClient(conn)
resp, err := client.ImportGraph(ctx, req)
if err != nil {
callback("", err)
return
}
respBytes, err := marshaler.Marshal(resp)
if err != nil {
callback("", err)
return
}
callback(string(respBytes), nil)
}
}