lnrpc: recompile protos

This commit is contained in:
Olaoluwa Osuntokun 2016-12-26 23:45:01 -06:00
parent d299be9785
commit f9f840feb6
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
3 changed files with 1518 additions and 251 deletions

File diff suppressed because it is too large Load Diff

View File

@ -342,6 +342,116 @@ func request_Lightning_DeleteAllPayments_0(ctx context.Context, marshaler runtim
} }
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_QueryRoute_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RouteRequest
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.QueryRoute(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 // RegisterLightningHandlerFromEndpoint is same as RegisterLightningHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done. // 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) { func RegisterLightningHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
@ -904,6 +1014,146 @@ func RegisterLightningHandler(ctx context.Context, mux *runtime.ServeMux, conn *
}) })
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_QueryRoute_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_QueryRoute_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_Lightning_QueryRoute_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 return nil
} }
@ -945,6 +1195,16 @@ var (
pattern_Lightning_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, "")) 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_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_QueryRoute_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", "route", "pub_key", "amt"}, ""))
pattern_Lightning_GetNetworkInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "info"}, ""))
) )
var ( var (
@ -985,4 +1245,14 @@ var (
forward_Lightning_ListPayments_0 = runtime.ForwardResponseMessage forward_Lightning_ListPayments_0 = runtime.ForwardResponseMessage
forward_Lightning_DeleteAllPayments_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_QueryRoute_0 = runtime.ForwardResponseMessage
forward_Lightning_GetNetworkInfo_0 = runtime.ForwardResponseMessage
) )

View File

@ -185,6 +185,120 @@
] ]
} }
}, },
"/v1/graph": {
"get": {
"operationId": "DescribeGraph",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/lnrpcChannelGraph"
}
}
},
"tags": [
"Lightning"
]
}
},
"/v1/graph/edge/{chan_id}": {
"get": {
"operationId": "GetChanInfo",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/lnrpcChannelEdge"
}
}
},
"parameters": [
{
"name": "chan_id",
"in": "path",
"required": true,
"type": "string",
"format": "uint64"
}
],
"tags": [
"Lightning"
]
}
},
"/v1/graph/info": {
"get": {
"operationId": "GetNetworkInfo",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/lnrpcNetworkInfo"
}
}
},
"tags": [
"Lightning"
]
}
},
"/v1/graph/node/{pub_key}": {
"get": {
"operationId": "GetNodeInfo",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/lnrpcNodeInfo"
}
}
},
"parameters": [
{
"name": "pub_key",
"in": "path",
"required": true,
"type": "string",
"format": "string"
}
],
"tags": [
"Lightning"
]
}
},
"/v1/graph/route/{pub_key}/{amt}": {
"get": {
"operationId": "QueryRoute",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/lnrpcRoute"
}
}
},
"parameters": [
{
"name": "pub_key",
"in": "path",
"required": true,
"type": "string",
"format": "string"
},
{
"name": "amt",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
}
],
"tags": [
"Lightning"
]
}
},
"/v1/invoices": { "/v1/invoices": {
"post": { "post": {
"operationId": "AddInvoice", "operationId": "AddInvoice",
@ -448,6 +562,10 @@
"type": "string", "type": "string",
"format": "int64" "format": "int64"
}, },
"chan_id": {
"type": "string",
"format": "uint64"
},
"channel_point": { "channel_point": {
"type": "string", "type": "string",
"format": "string" "format": "string"
@ -497,6 +615,15 @@
} }
} }
}, },
"lnrpcChanInfoRequest": {
"type": "object",
"properties": {
"chan_id": {
"type": "string",
"format": "uint64"
}
}
},
"lnrpcChannelBalanceRequest": { "lnrpcChannelBalanceRequest": {
"type": "object" "type": "object"
}, },
@ -522,6 +649,61 @@
} }
} }
}, },
"lnrpcChannelEdge": {
"type": "object",
"properties": {
"capacity": {
"type": "string",
"format": "int64"
},
"chan_point": {
"type": "string",
"format": "string"
},
"channel_id": {
"type": "string",
"format": "uint64"
},
"last_update": {
"type": "integer",
"format": "int64"
},
"node1_policy": {
"$ref": "#/definitions/lnrpcRoutingPolicy"
},
"node1_pub": {
"type": "string",
"format": "string"
},
"node2_policy": {
"$ref": "#/definitions/lnrpcRoutingPolicy"
},
"node2_pub": {
"type": "string",
"format": "string"
}
}
},
"lnrpcChannelGraph": {
"type": "object",
"properties": {
"edges": {
"type": "array",
"items": {
"$ref": "#/definitions/lnrpcChannelEdge"
}
},
"nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/lnrpcLightningNode"
}
}
}
},
"lnrpcChannelGraphRequest": {
"type": "object"
},
"lnrpcChannelPoint": { "lnrpcChannelPoint": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -624,6 +806,14 @@
"lnrpcGetInfoResponse": { "lnrpcGetInfoResponse": {
"type": "object", "type": "object",
"properties": { "properties": {
"alias": {
"type": "string",
"format": "string"
},
"block_hash": {
"type": "string",
"format": "string"
},
"block_height": { "block_height": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
@ -682,6 +872,27 @@
} }
} }
}, },
"lnrpcHop": {
"type": "object",
"properties": {
"amt_to_forward": {
"type": "string",
"format": "int64"
},
"chan_capacity": {
"type": "string",
"format": "int64"
},
"chan_id": {
"type": "string",
"format": "uint64"
},
"fee": {
"type": "string",
"format": "int64"
}
}
},
"lnrpcInvoice": { "lnrpcInvoice": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -735,6 +946,27 @@
} }
} }
}, },
"lnrpcLightningNode": {
"type": "object",
"properties": {
"address": {
"type": "string",
"format": "string"
},
"alias": {
"type": "string",
"format": "string"
},
"last_update": {
"type": "integer",
"format": "int64"
},
"pub_key": {
"type": "string",
"format": "string"
}
}
},
"lnrpcListChannelsRequest": { "lnrpcListChannelsRequest": {
"type": "object" "type": "object"
}, },
@ -797,6 +1029,50 @@
} }
} }
}, },
"lnrpcNetworkInfo": {
"type": "object",
"properties": {
"avg_channel_size": {
"type": "number",
"format": "double"
},
"avg_out_degree": {
"type": "number",
"format": "double"
},
"graph_diameter": {
"type": "integer",
"format": "int64"
},
"max_channel_size": {
"type": "string",
"format": "int64"
},
"max_out_degree": {
"type": "integer",
"format": "int64"
},
"min_channel_size": {
"type": "string",
"format": "int64"
},
"num_channels": {
"type": "integer",
"format": "int64"
},
"num_nodes": {
"type": "integer",
"format": "int64"
},
"total_network_capacity": {
"type": "string",
"format": "int64"
}
}
},
"lnrpcNetworkInfoRequest": {
"type": "object"
},
"lnrpcNewAddressResponse": { "lnrpcNewAddressResponse": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -809,6 +1085,31 @@
"lnrpcNewWitnessAddressRequest": { "lnrpcNewWitnessAddressRequest": {
"type": "object" "type": "object"
}, },
"lnrpcNodeInfo": {
"type": "object",
"properties": {
"node": {
"$ref": "#/definitions/lnrpcLightningNode"
},
"num_channels": {
"type": "integer",
"format": "int64"
},
"total_capacity": {
"type": "string",
"format": "int64"
}
}
},
"lnrpcNodeInfoRequest": {
"type": "object",
"properties": {
"pub_key": {
"type": "string",
"format": "string"
}
}
},
"lnrpcOpenChannelRequest": { "lnrpcOpenChannelRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -948,6 +1249,63 @@
} }
} }
}, },
"lnrpcRoute": {
"type": "object",
"properties": {
"hops": {
"type": "array",
"items": {
"$ref": "#/definitions/lnrpcHop"
}
},
"total_amt": {
"type": "string",
"format": "int64"
},
"total_fees": {
"type": "string",
"format": "int64"
},
"total_time_lock": {
"type": "integer",
"format": "int64"
}
}
},
"lnrpcRouteRequest": {
"type": "object",
"properties": {
"amt": {
"type": "string",
"format": "int64"
},
"pub_key": {
"type": "string",
"format": "string"
}
}
},
"lnrpcRoutingPolicy": {
"type": "object",
"properties": {
"fee_base_msat": {
"type": "string",
"format": "int64"
},
"fee_rate_milli_msat": {
"type": "string",
"format": "int64"
},
"min_htlc": {
"type": "string",
"format": "int64"
},
"time_lock_delta": {
"type": "integer",
"format": "int64"
}
}
},
"lnrpcSendCoinsRequest": { "lnrpcSendCoinsRequest": {
"type": "object", "type": "object",
"properties": { "properties": {