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

This commit is contained in:
Keagan McClelland 2023-11-14 17:30:34 -08:00
parent 179295e441
commit 4eca04e6a0
3 changed files with 50 additions and 12 deletions

View File

@ -4,10 +4,28 @@ package wtclientrpc;
option go_package = "github.com/lightningnetwork/lnd/lnrpc/wtclientrpc";
/*
* 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
*/
// WatchtowerClient is a service that grants access to the watchtower client
// functionality of the daemon.
service WatchtowerClient {
/*
/* lncli: `wtclient add`
AddTower adds a new watchtower reachable at the given address and
considers it for new sessions. If the watchtower already exists, then
any new addresses included will be considered when dialing it for
@ -15,7 +33,7 @@ service WatchtowerClient {
*/
rpc AddTower (AddTowerRequest) returns (AddTowerResponse);
/*
/* lncli: `wtclient remove`
RemoveTower removes a watchtower from being considered for future session
negotiations and from being used for any subsequent backups until it's added
again. If an address is provided, then this RPC only serves as a way of
@ -23,16 +41,24 @@ service WatchtowerClient {
*/
rpc RemoveTower (RemoveTowerRequest) returns (RemoveTowerResponse);
// ListTowers returns the list of watchtowers registered with the client.
/* lncli: `wtclient towers`
ListTowers returns the list of watchtowers registered with the client.
*/
rpc ListTowers (ListTowersRequest) returns (ListTowersResponse);
// GetTowerInfo retrieves information for a registered watchtower.
/* lncli: `wtclient tower`
GetTowerInfo retrieves information for a registered watchtower.
*/
rpc GetTowerInfo (GetTowerInfoRequest) returns (Tower);
// Stats returns the in-memory statistics of the client since startup.
/* lncli: `wtclient stats`
Stats returns the in-memory statistics of the client since startup.
*/
rpc Stats (StatsRequest) returns (StatsResponse);
// Policy returns the active watchtower client policy configuration.
/* lncli: `wtclient policy`
Policy returns the active watchtower client policy configuration.
*/
rpc Policy (PolicyRequest) returns (PolicyResponse);
}

View File

@ -18,7 +18,7 @@
"paths": {
"/v2/watchtower/client": {
"get": {
"summary": "ListTowers returns the list of watchtowers registered with the client.",
"summary": "lncli: `wtclient towers`\nListTowers returns the list of watchtowers registered with the client.",
"operationId": "WatchtowerClient_ListTowers",
"responses": {
"200": {
@ -55,7 +55,7 @@
]
},
"post": {
"summary": "AddTower adds a new watchtower reachable at the given address and\nconsiders it for new sessions. If the watchtower already exists, then\nany new addresses included will be considered when dialing it for\nsession negotiations and backups.",
"summary": "lncli: `wtclient add`\nAddTower adds a new watchtower reachable at the given address and\nconsiders it for new sessions. If the watchtower already exists, then\nany new addresses included will be considered when dialing it for\nsession negotiations and backups.",
"operationId": "WatchtowerClient_AddTower",
"responses": {
"200": {
@ -88,7 +88,7 @@
},
"/v2/watchtower/client/info/{pubkey}": {
"get": {
"summary": "GetTowerInfo retrieves information for a registered watchtower.",
"summary": "lncli: `wtclient tower`\nGetTowerInfo retrieves information for a registered watchtower.",
"operationId": "WatchtowerClient_GetTowerInfo",
"responses": {
"200": {
@ -135,7 +135,7 @@
},
"/v2/watchtower/client/policy": {
"get": {
"summary": "Policy returns the active watchtower client policy configuration.",
"summary": "lncli: `wtclient policy`\nPolicy returns the active watchtower client policy configuration.",
"operationId": "WatchtowerClient_Policy",
"responses": {
"200": {
@ -172,7 +172,7 @@
},
"/v2/watchtower/client/stats": {
"get": {
"summary": "Stats returns the in-memory statistics of the client since startup.",
"summary": "lncli: `wtclient stats`\nStats returns the in-memory statistics of the client since startup.",
"operationId": "WatchtowerClient_Stats",
"responses": {
"200": {
@ -195,7 +195,7 @@
},
"/v2/watchtower/client/{pubkey}": {
"delete": {
"summary": "RemoveTower removes a watchtower from being considered for future session\nnegotiations and from being used for any subsequent backups until it's added\nagain. If an address is provided, then this RPC only serves as a way of\nremoving the address from the watchtower instead.",
"summary": "lncli: `wtclient remove`\nRemoveTower removes a watchtower from being considered for future session\nnegotiations and from being used for any subsequent backups until it's added\nagain. If an address is provided, then this RPC only serves as a way of\nremoving the address from the watchtower instead.",
"operationId": "WatchtowerClient_RemoveTower",
"responses": {
"200": {

View File

@ -18,22 +18,28 @@ const _ = grpc.SupportPackageIsVersion7
//
// 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 WatchtowerClientClient interface {
// lncli: `wtclient add`
// AddTower adds a new watchtower reachable at the given address and
// considers it for new sessions. If the watchtower already exists, then
// any new addresses included will be considered when dialing it for
// session negotiations and backups.
AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error)
// lncli: `wtclient remove`
// RemoveTower removes a watchtower from being considered for future session
// negotiations and from being used for any subsequent backups until it's added
// again. If an address is provided, then this RPC only serves as a way of
// removing the address from the watchtower instead.
RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error)
// lncli: `wtclient towers`
// ListTowers returns the list of watchtowers registered with the client.
ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error)
// lncli: `wtclient tower`
// GetTowerInfo retrieves information for a registered watchtower.
GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error)
// lncli: `wtclient stats`
// Stats returns the in-memory statistics of the client since startup.
Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)
// lncli: `wtclient policy`
// Policy returns the active watchtower client policy configuration.
Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error)
}
@ -104,22 +110,28 @@ func (c *watchtowerClientClient) Policy(ctx context.Context, in *PolicyRequest,
// All implementations must embed UnimplementedWatchtowerClientServer
// for forward compatibility
type WatchtowerClientServer interface {
// lncli: `wtclient add`
// AddTower adds a new watchtower reachable at the given address and
// considers it for new sessions. If the watchtower already exists, then
// any new addresses included will be considered when dialing it for
// session negotiations and backups.
AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error)
// lncli: `wtclient remove`
// RemoveTower removes a watchtower from being considered for future session
// negotiations and from being used for any subsequent backups until it's added
// again. If an address is provided, then this RPC only serves as a way of
// removing the address from the watchtower instead.
RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error)
// lncli: `wtclient towers`
// ListTowers returns the list of watchtowers registered with the client.
ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error)
// lncli: `wtclient tower`
// GetTowerInfo retrieves information for a registered watchtower.
GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error)
// lncli: `wtclient stats`
// Stats returns the in-memory statistics of the client since startup.
Stats(context.Context, *StatsRequest) (*StatsResponse, error)
// lncli: `wtclient policy`
// Policy returns the active watchtower client policy configuration.
Policy(context.Context, *PolicyRequest) (*PolicyResponse, error)
mustEmbedUnimplementedWatchtowerClientServer()