mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
04a6c2f7f6
This commit converts the previous QueryRoute command to a new command: QueryRoutes. This command is identical to QueryRoute other than the fact that it’s able to return multiple routes rather than a single route.
1318 lines
46 KiB
Go
1318 lines
46 KiB
Go
// Code generated by protoc-gen-grpc-gateway
|
|
// source: rpc.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package lnrpc is a reverse proxy.
|
|
|
|
It translates gRPC into RESTful JSON APIs.
|
|
*/
|
|
package lnrpc
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
|
"golang.org/x/net/context"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/grpclog"
|
|
)
|
|
|
|
var _ codes.Code
|
|
var _ io.Reader
|
|
var _ = runtime.String
|
|
var _ = utilities.NewDoubleArray
|
|
|
|
var (
|
|
filter_Lightning_WalletBalance_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
)
|
|
|
|
func request_Lightning_WalletBalance_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq WalletBalanceRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_WalletBalance_0); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.WalletBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ChannelBalance_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ChannelBalanceRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.ChannelBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_GetTransactions_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq GetTransactionsRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.GetTransactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_SendCoins_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq SendCoinsRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.SendCoins(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_NewWitnessAddress_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq NewWitnessAddressRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.NewWitnessAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ConnectPeer_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ConnectPeerRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.ConnectPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ListPeersRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq GetInfoRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.GetInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
var (
|
|
filter_Lightning_PendingChannels_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
)
|
|
|
|
func request_Lightning_PendingChannels_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq PendingChannelRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_PendingChannels_0); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.PendingChannels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ListChannels_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ListChannelsRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.ListChannels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_OpenChannelSync_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq OpenChannelRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.OpenChannelSync(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
var (
|
|
filter_Lightning_CloseChannel_0 = &utilities.DoubleArray{Encoding: map[string]int{"channel_point": 0, "funding_txid": 1, "output_index": 2, "force": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 1, 3, 4, 5}}
|
|
)
|
|
|
|
func request_Lightning_CloseChannel_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (Lightning_CloseChannelClient, runtime.ServerMetadata, error) {
|
|
var protoReq CloseChannelRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["channel_point.funding_txid"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_point.funding_txid")
|
|
}
|
|
|
|
err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.funding_txid", val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
val, ok = pathParams["channel_point.output_index"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_point.output_index")
|
|
}
|
|
|
|
err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.output_index", val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
val, ok = pathParams["force"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "force")
|
|
}
|
|
|
|
protoReq.Force, err = runtime.Bool(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_CloseChannel_0); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
stream, err := client.CloseChannel(ctx, &protoReq)
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
header, err := stream.Header()
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
metadata.HeaderMD = header
|
|
return stream, metadata, nil
|
|
|
|
}
|
|
|
|
func request_Lightning_SendPaymentSync_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq SendRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.SendPaymentSync(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_AddInvoice_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq Invoice
|
|
var metadata runtime.ServerMetadata
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.AddInvoice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ListInvoices_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ListInvoiceRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["pending_only"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "pending_only")
|
|
}
|
|
|
|
protoReq.PendingOnly, err = runtime.Bool(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
msg, err := client.ListInvoices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
var (
|
|
filter_Lightning_LookupInvoice_0 = &utilities.DoubleArray{Encoding: map[string]int{"r_hash_str": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
|
)
|
|
|
|
func request_Lightning_LookupInvoice_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq PaymentHash
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["r_hash_str"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "r_hash_str")
|
|
}
|
|
|
|
protoReq.RHashStr, err = runtime.String(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_LookupInvoice_0); err != nil {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.LookupInvoice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_SubscribeInvoices_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (Lightning_SubscribeInvoicesClient, runtime.ServerMetadata, error) {
|
|
var protoReq InvoiceSubscription
|
|
var metadata runtime.ServerMetadata
|
|
|
|
stream, err := client.SubscribeInvoices(ctx, &protoReq)
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
header, err := stream.Header()
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
metadata.HeaderMD = header
|
|
return stream, metadata, nil
|
|
|
|
}
|
|
|
|
func request_Lightning_DecodePayReq_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq PayReqString
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["pay_req"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "pay_req")
|
|
}
|
|
|
|
protoReq.PayReq, err = runtime.String(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
msg, err := client.DecodePayReq(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ListPaymentsRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.ListPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_DeleteAllPayments_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq DeleteAllPaymentsRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.DeleteAllPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_DescribeGraph_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ChannelGraphRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.DescribeGraph(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_GetChanInfo_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq ChanInfoRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["chan_id"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "chan_id")
|
|
}
|
|
|
|
protoReq.ChanId, err = runtime.Uint64(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
msg, err := client.GetChanInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq NodeInfoRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["pub_key"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "pub_key")
|
|
}
|
|
|
|
protoReq.PubKey, err = runtime.String(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
msg, err := client.GetNodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_QueryRoutes_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq QueryRoutesRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
var (
|
|
val string
|
|
ok bool
|
|
err error
|
|
_ = err
|
|
)
|
|
|
|
val, ok = pathParams["pub_key"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "pub_key")
|
|
}
|
|
|
|
protoReq.PubKey, err = runtime.String(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
val, ok = pathParams["amt"]
|
|
if !ok {
|
|
return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "amt")
|
|
}
|
|
|
|
protoReq.Amt, err = runtime.Int64(val)
|
|
|
|
if err != nil {
|
|
return nil, metadata, err
|
|
}
|
|
|
|
msg, err := client.QueryRoutes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func request_Lightning_GetNetworkInfo_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq NetworkInfoRequest
|
|
var metadata runtime.ServerMetadata
|
|
|
|
msg, err := client.GetNetworkInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
// RegisterLightningHandlerFromEndpoint is same as RegisterLightningHandler but
|
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
|
func RegisterLightningHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
|
conn, err := grpc.Dial(endpoint, opts...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err != nil {
|
|
if cerr := conn.Close(); cerr != nil {
|
|
grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr)
|
|
}
|
|
return
|
|
}
|
|
go func() {
|
|
<-ctx.Done()
|
|
if cerr := conn.Close(); cerr != nil {
|
|
grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr)
|
|
}
|
|
}()
|
|
}()
|
|
|
|
return RegisterLightningHandler(ctx, mux, conn)
|
|
}
|
|
|
|
// RegisterLightningHandler registers the http handlers for service Lightning to "mux".
|
|
// The handlers forward requests to the grpc endpoint over "conn".
|
|
func RegisterLightningHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
|
client := NewLightningClient(conn)
|
|
|
|
mux.Handle("GET", pattern_Lightning_WalletBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_WalletBalance_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_WalletBalance_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_ChannelBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ChannelBalance_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ChannelBalance_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_GetTransactions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_GetTransactions_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_GetTransactions_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("POST", pattern_Lightning_SendCoins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_SendCoins_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_SendCoins_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_NewWitnessAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_NewWitnessAddress_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_NewWitnessAddress_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("POST", pattern_Lightning_ConnectPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ConnectPeer_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ConnectPeer_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ListPeers_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_GetInfo_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_GetInfo_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_PendingChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_PendingChannels_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_PendingChannels_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_ListChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ListChannels_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ListChannels_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("POST", pattern_Lightning_OpenChannelSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_OpenChannelSync_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_OpenChannelSync_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("DELETE", pattern_Lightning_CloseChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_CloseChannel_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_CloseChannel_0(ctx, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("POST", pattern_Lightning_SendPaymentSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_SendPaymentSync_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_SendPaymentSync_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("POST", pattern_Lightning_AddInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_AddInvoice_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_AddInvoice_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_ListInvoices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ListInvoices_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ListInvoices_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_LookupInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_LookupInvoice_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_LookupInvoice_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_SubscribeInvoices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_SubscribeInvoices_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_SubscribeInvoices_0(ctx, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_DecodePayReq_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_DecodePayReq_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_DecodePayReq_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_ListPayments_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_ListPayments_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("DELETE", pattern_Lightning_DeleteAllPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_DeleteAllPayments_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_DeleteAllPayments_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_DescribeGraph_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_DescribeGraph_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_DescribeGraph_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_GetChanInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_GetChanInfo_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_GetChanInfo_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_GetNodeInfo_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_GetNodeInfo_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_QueryRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_QueryRoutes_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_QueryRoutes_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
mux.Handle("GET", pattern_Lightning_GetNetworkInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
defer cancel()
|
|
if cn, ok := w.(http.CloseNotifier); ok {
|
|
go func(done <-chan struct{}, closed <-chan bool) {
|
|
select {
|
|
case <-done:
|
|
case <-closed:
|
|
cancel()
|
|
}
|
|
}(ctx.Done(), cn.CloseNotify())
|
|
}
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
rctx, err := runtime.AnnotateContext(ctx, req)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
}
|
|
resp, md, err := request_Lightning_GetNetworkInfo_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_Lightning_GetNetworkInfo_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
|
|
return nil
|
|
}
|
|
|
|
var (
|
|
pattern_Lightning_WalletBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "blockchain"}, ""))
|
|
|
|
pattern_Lightning_ChannelBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "channels"}, ""))
|
|
|
|
pattern_Lightning_GetTransactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, ""))
|
|
|
|
pattern_Lightning_SendCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, ""))
|
|
|
|
pattern_Lightning_NewWitnessAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "newaddress"}, ""))
|
|
|
|
pattern_Lightning_ConnectPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, ""))
|
|
|
|
pattern_Lightning_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, ""))
|
|
|
|
pattern_Lightning_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getinfo"}, ""))
|
|
|
|
pattern_Lightning_PendingChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "pending"}, ""))
|
|
|
|
pattern_Lightning_ListChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, ""))
|
|
|
|
pattern_Lightning_OpenChannelSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, ""))
|
|
|
|
pattern_Lightning_CloseChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "channels", "channel_point.funding_txid", "channel_point.output_index", "force"}, ""))
|
|
|
|
pattern_Lightning_SendPaymentSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "transactions"}, ""))
|
|
|
|
pattern_Lightning_AddInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "invoices"}, ""))
|
|
|
|
pattern_Lightning_ListInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "invoices", "pending_only"}, ""))
|
|
|
|
pattern_Lightning_LookupInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "invoices", "r_hash_str"}, ""))
|
|
|
|
pattern_Lightning_SubscribeInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "invoices", "subscribe"}, ""))
|
|
|
|
pattern_Lightning_DecodePayReq_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "payreq", "pay_req"}, ""))
|
|
|
|
pattern_Lightning_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, ""))
|
|
|
|
pattern_Lightning_DeleteAllPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, ""))
|
|
|
|
pattern_Lightning_DescribeGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "graph"}, ""))
|
|
|
|
pattern_Lightning_GetChanInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "edge", "chan_id"}, ""))
|
|
|
|
pattern_Lightning_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "node", "pub_key"}, ""))
|
|
|
|
pattern_Lightning_QueryRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "graph", "routes", "pub_key", "amt"}, ""))
|
|
|
|
pattern_Lightning_GetNetworkInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "info"}, ""))
|
|
)
|
|
|
|
var (
|
|
forward_Lightning_WalletBalance_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ChannelBalance_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_GetTransactions_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_SendCoins_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_NewWitnessAddress_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ConnectPeer_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ListPeers_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_GetInfo_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_PendingChannels_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ListChannels_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_OpenChannelSync_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_CloseChannel_0 = runtime.ForwardResponseStream
|
|
|
|
forward_Lightning_SendPaymentSync_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_AddInvoice_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ListInvoices_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_LookupInvoice_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_SubscribeInvoices_0 = runtime.ForwardResponseStream
|
|
|
|
forward_Lightning_DecodePayReq_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_ListPayments_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_DeleteAllPayments_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_DescribeGraph_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_GetChanInfo_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_GetNodeInfo_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_QueryRoutes_0 = runtime.ForwardResponseMessage
|
|
|
|
forward_Lightning_GetNetworkInfo_0 = runtime.ForwardResponseMessage
|
|
)
|