lnrpc: add invoicesrpc doc tags to enable lncli api doc generation

This commit is contained in:
Keagan McClelland 2023-11-14 17:02:54 -08:00
parent b855566e6b
commit bba09e320c
3 changed files with 30 additions and 6 deletions

View File

@ -6,6 +6,24 @@ package invoicesrpc;
option go_package = "github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"; option go_package = "github.com/lightningnetwork/lnd/lnrpc/invoicesrpc";
/*
* Comments in this file will be directly parsed into the API
* Documentation as descriptions of the associated method, message, or field.
* These descriptions should go right above the definition of the object, and
* can be in either block or // comment format.
*
* An RPC method can be matched to an lncli command by placing a line in the
* beginning of the description in exactly the following format:
* lncli: `methodname`
*
* Failure to specify the exact name of the command will cause documentation
* generation to fail.
*
* More information on how exactly the gRPC documentation is generated from
* this proto file can be found here:
* https://github.com/lightninglabs/lightning-api
*/
// Invoices is a service that can be used to create, accept, settle and cancel // Invoices is a service that can be used to create, accept, settle and cancel
// invoices. // invoices.
service Invoices { service Invoices {
@ -17,20 +35,20 @@ service Invoices {
rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest) rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest)
returns (stream lnrpc.Invoice); returns (stream lnrpc.Invoice);
/* /* lncli: `cancelinvoice`
CancelInvoice cancels a currently open invoice. If the invoice is already CancelInvoice cancels a currently open invoice. If the invoice is already
canceled, this call will succeed. If the invoice is already settled, it will canceled, this call will succeed. If the invoice is already settled, it will
fail. fail.
*/ */
rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp); rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp);
/* /* lncli: `addholdinvoice`
AddHoldInvoice creates a hold invoice. It ties the invoice to the hash AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
supplied in the request. supplied in the request.
*/ */
rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp); rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp);
/* /* lncli: `settleinvoice`
SettleInvoice settles an accepted invoice. If the invoice is already SettleInvoice settles an accepted invoice. If the invoice is already
settled, this call will succeed. settled, this call will succeed.
*/ */

View File

@ -18,7 +18,7 @@
"paths": { "paths": {
"/v2/invoices/cancel": { "/v2/invoices/cancel": {
"post": { "post": {
"summary": "CancelInvoice cancels a currently open invoice. If the invoice is already\ncanceled, this call will succeed. If the invoice is already settled, it will\nfail.", "summary": "lncli: `cancelinvoice`\nCancelInvoice cancels a currently open invoice. If the invoice is already\ncanceled, this call will succeed. If the invoice is already settled, it will\nfail.",
"operationId": "Invoices_CancelInvoice", "operationId": "Invoices_CancelInvoice",
"responses": { "responses": {
"200": { "200": {
@ -51,7 +51,7 @@
}, },
"/v2/invoices/hodl": { "/v2/invoices/hodl": {
"post": { "post": {
"summary": "AddHoldInvoice creates a hold invoice. It ties the invoice to the hash\nsupplied in the request.", "summary": "lncli: `addholdinvoice`\nAddHoldInvoice creates a hold invoice. It ties the invoice to the hash\nsupplied in the request.",
"operationId": "Invoices_AddHoldInvoice", "operationId": "Invoices_AddHoldInvoice",
"responses": { "responses": {
"200": { "200": {
@ -144,7 +144,7 @@
}, },
"/v2/invoices/settle": { "/v2/invoices/settle": {
"post": { "post": {
"summary": "SettleInvoice settles an accepted invoice. If the invoice is already\nsettled, this call will succeed.", "summary": "lncli: `settleinvoice`\nSettleInvoice settles an accepted invoice. If the invoice is already\nsettled, this call will succeed.",
"operationId": "Invoices_SettleInvoice", "operationId": "Invoices_SettleInvoice",
"responses": { "responses": {
"200": { "200": {

View File

@ -23,13 +23,16 @@ type InvoicesClient interface {
// to notify the client of state transitions of the specified invoice. // to notify the client of state transitions of the specified invoice.
// Initially the current invoice state is always sent out. // Initially the current invoice state is always sent out.
SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error)
// lncli: `cancelinvoice`
// CancelInvoice cancels a currently open invoice. If the invoice is already // CancelInvoice cancels a currently open invoice. If the invoice is already
// canceled, this call will succeed. If the invoice is already settled, it will // canceled, this call will succeed. If the invoice is already settled, it will
// fail. // fail.
CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error)
// lncli: `addholdinvoice`
// AddHoldInvoice creates a hold invoice. It ties the invoice to the hash // AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
// supplied in the request. // supplied in the request.
AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error)
// lncli: `settleinvoice`
// SettleInvoice settles an accepted invoice. If the invoice is already // SettleInvoice settles an accepted invoice. If the invoice is already
// settled, this call will succeed. // settled, this call will succeed.
SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error)
@ -122,13 +125,16 @@ type InvoicesServer interface {
// to notify the client of state transitions of the specified invoice. // to notify the client of state transitions of the specified invoice.
// Initially the current invoice state is always sent out. // Initially the current invoice state is always sent out.
SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
// lncli: `cancelinvoice`
// CancelInvoice cancels a currently open invoice. If the invoice is already // CancelInvoice cancels a currently open invoice. If the invoice is already
// canceled, this call will succeed. If the invoice is already settled, it will // canceled, this call will succeed. If the invoice is already settled, it will
// fail. // fail.
CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error)
// lncli: `addholdinvoice`
// AddHoldInvoice creates a hold invoice. It ties the invoice to the hash // AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
// supplied in the request. // supplied in the request.
AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
// lncli: `settleinvoice`
// SettleInvoice settles an accepted invoice. If the invoice is already // SettleInvoice settles an accepted invoice. If the invoice is already
// settled, this call will succeed. // settled, this call will succeed.
SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error)