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

This commit is contained in:
Keagan McClelland
2023-11-14 16:58:14 -08:00
parent c0da9ca1b0
commit b855566e6b
3 changed files with 26 additions and 4 deletions

View File

@@ -4,11 +4,29 @@ package autopilotrpc;
option go_package = "github.com/lightningnetwork/lnd/lnrpc/autopilotrpc"; option go_package = "github.com/lightningnetwork/lnd/lnrpc/autopilotrpc";
/*
* 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
*/
// Autopilot is a service that can be used to get information about the current // Autopilot is a service that can be used to get information about the current
// state of the daemon's autopilot agent, and also supply it with information // state of the daemon's autopilot agent, and also supply it with information
// that can be used when deciding where to open channels. // that can be used when deciding where to open channels.
service Autopilot { service Autopilot {
/* /* lncli: `autopilot status`
Status returns whether the daemon's autopilot agent is active. Status returns whether the daemon's autopilot agent is active.
*/ */
rpc Status (StatusRequest) returns (StatusResponse); rpc Status (StatusRequest) returns (StatusResponse);
@@ -19,7 +37,7 @@ service Autopilot {
*/ */
rpc ModifyStatus (ModifyStatusRequest) returns (ModifyStatusResponse); rpc ModifyStatus (ModifyStatusRequest) returns (ModifyStatusResponse);
/* /* lncli: `autopilot query`
QueryScores queries all available autopilot heuristics, in addition to any QueryScores queries all available autopilot heuristics, in addition to any
active combination of these heruristics, for the scores they would give to active combination of these heruristics, for the scores they would give to
the given nodes. the given nodes.

View File

@@ -51,7 +51,7 @@
}, },
"/v2/autopilot/scores": { "/v2/autopilot/scores": {
"get": { "get": {
"summary": "QueryScores queries all available autopilot heuristics, in addition to any\nactive combination of these heruristics, for the scores they would give to\nthe given nodes.", "summary": "lncli: `autopilot query`\nQueryScores queries all available autopilot heuristics, in addition to any\nactive combination of these heruristics, for the scores they would give to\nthe given nodes.",
"operationId": "Autopilot_QueryScores", "operationId": "Autopilot_QueryScores",
"responses": { "responses": {
"200": { "200": {
@@ -124,7 +124,7 @@
}, },
"/v2/autopilot/status": { "/v2/autopilot/status": {
"get": { "get": {
"summary": "Status returns whether the daemon's autopilot agent is active.", "summary": "lncli: `autopilot status`\nStatus returns whether the daemon's autopilot agent is active.",
"operationId": "Autopilot_Status", "operationId": "Autopilot_Status",
"responses": { "responses": {
"200": { "200": {

View File

@@ -18,11 +18,13 @@ 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. // 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 AutopilotClient interface { type AutopilotClient interface {
// lncli: `autopilot status`
// Status returns whether the daemon's autopilot agent is active. // Status returns whether the daemon's autopilot agent is active.
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
// ModifyStatus is used to modify the status of the autopilot agent, like // ModifyStatus is used to modify the status of the autopilot agent, like
// enabling or disabling it. // enabling or disabling it.
ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error) ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error)
// lncli: `autopilot query`
// QueryScores queries all available autopilot heuristics, in addition to any // QueryScores queries all available autopilot heuristics, in addition to any
// active combination of these heruristics, for the scores they would give to // active combination of these heruristics, for the scores they would give to
// the given nodes. // the given nodes.
@@ -80,11 +82,13 @@ func (c *autopilotClient) SetScores(ctx context.Context, in *SetScoresRequest, o
// All implementations must embed UnimplementedAutopilotServer // All implementations must embed UnimplementedAutopilotServer
// for forward compatibility // for forward compatibility
type AutopilotServer interface { type AutopilotServer interface {
// lncli: `autopilot status`
// Status returns whether the daemon's autopilot agent is active. // Status returns whether the daemon's autopilot agent is active.
Status(context.Context, *StatusRequest) (*StatusResponse, error) Status(context.Context, *StatusRequest) (*StatusResponse, error)
// ModifyStatus is used to modify the status of the autopilot agent, like // ModifyStatus is used to modify the status of the autopilot agent, like
// enabling or disabling it. // enabling or disabling it.
ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error) ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error)
// lncli: `autopilot query`
// QueryScores queries all available autopilot heuristics, in addition to any // QueryScores queries all available autopilot heuristics, in addition to any
// active combination of these heruristics, for the scores they would give to // active combination of these heruristics, for the scores they would give to
// the given nodes. // the given nodes.