From 6c3fa5a6adeade8309573c7ed07de00406871ebd Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Sun, 19 Mar 2023 17:57:29 +0200 Subject: [PATCH] litrpc: add cli directives to Autopilot service --- litrpc/lit-autopilot.pb.go | 1 + litrpc/lit-autopilot.proto | 19 +++++++++++++++++++ litrpc/lit-autopilot_grpc.pb.go | 24 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/litrpc/lit-autopilot.pb.go b/litrpc/lit-autopilot.pb.go index 7c5d1a82..aa162caf 100644 --- a/litrpc/lit-autopilot.pb.go +++ b/litrpc/lit-autopilot.pb.go @@ -408,6 +408,7 @@ type RevokeAutopilotSessionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The local static public key of the Autopilot session to be revoked. LocalPublicKey []byte `protobuf:"bytes,1,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"` } diff --git a/litrpc/lit-autopilot.proto b/litrpc/lit-autopilot.proto index 740829d5..26c57c3f 100644 --- a/litrpc/lit-autopilot.proto +++ b/litrpc/lit-autopilot.proto @@ -7,15 +7,31 @@ package litrpc; option go_package = "github.com/lightninglabs/lightning-terminal/litrpc"; service Autopilot { + /* litcli: `autopilot features` + ListAutopilotFeatures fetches all the features supported by the Autopilot + server along with the rules that we need to support in order to subscribe + to those features. + */ rpc ListAutopilotFeatures (ListAutopilotFeaturesRequest) returns (ListAutopilotFeaturesResponse); + /* litcli: `autopilot add` + AddAutopilotSession creates a new LNC session and attempts to register it + with the Autopilot server. + */ rpc AddAutopilotSession (AddAutopilotSessionRequest) returns (AddAutopilotSessionResponse); + /* litcli: `autopilot list` + ListAutopilotSessions lists all the sessions that are of type + TypeAutopilot. + */ rpc ListAutopilotSessions (ListAutopilotSessionsRequest) returns (ListAutopilotSessionsResponse); + /* litcli: `autopilot revoke` + RevokeAutopilotSession revokes an Autopilot session. + */ rpc RevokeAutopilotSession (RevokeAutopilotSessionRequest) returns (RevokeAutopilotSessionResponse); } @@ -101,6 +117,9 @@ message ListAutopilotFeaturesResponse { } message RevokeAutopilotSessionRequest { + /* + The local static public key of the Autopilot session to be revoked. + */ bytes local_public_key = 1; } diff --git a/litrpc/lit-autopilot_grpc.pb.go b/litrpc/lit-autopilot_grpc.pb.go index 04e53f68..5cd09c35 100644 --- a/litrpc/lit-autopilot_grpc.pb.go +++ b/litrpc/lit-autopilot_grpc.pb.go @@ -18,9 +18,21 @@ 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 AutopilotClient interface { + // litcli: `autopilot features` + // ListAutopilotFeatures fetches all the features supported by the Autopilot + // server along with the rules that we need to support in order to subscribe + // to those features. ListAutopilotFeatures(ctx context.Context, in *ListAutopilotFeaturesRequest, opts ...grpc.CallOption) (*ListAutopilotFeaturesResponse, error) + // litcli: `autopilot add` + // AddAutopilotSession creates a new LNC session and attempts to register it + // with the Autopilot server. AddAutopilotSession(ctx context.Context, in *AddAutopilotSessionRequest, opts ...grpc.CallOption) (*AddAutopilotSessionResponse, error) + // litcli: `autopilot list` + // ListAutopilotSessions lists all the sessions that are of type + // TypeAutopilot. ListAutopilotSessions(ctx context.Context, in *ListAutopilotSessionsRequest, opts ...grpc.CallOption) (*ListAutopilotSessionsResponse, error) + // litcli: `autopilot revoke` + // RevokeAutopilotSession revokes an Autopilot session. RevokeAutopilotSession(ctx context.Context, in *RevokeAutopilotSessionRequest, opts ...grpc.CallOption) (*RevokeAutopilotSessionResponse, error) } @@ -72,9 +84,21 @@ func (c *autopilotClient) RevokeAutopilotSession(ctx context.Context, in *Revoke // All implementations must embed UnimplementedAutopilotServer // for forward compatibility type AutopilotServer interface { + // litcli: `autopilot features` + // ListAutopilotFeatures fetches all the features supported by the Autopilot + // server along with the rules that we need to support in order to subscribe + // to those features. ListAutopilotFeatures(context.Context, *ListAutopilotFeaturesRequest) (*ListAutopilotFeaturesResponse, error) + // litcli: `autopilot add` + // AddAutopilotSession creates a new LNC session and attempts to register it + // with the Autopilot server. AddAutopilotSession(context.Context, *AddAutopilotSessionRequest) (*AddAutopilotSessionResponse, error) + // litcli: `autopilot list` + // ListAutopilotSessions lists all the sessions that are of type + // TypeAutopilot. ListAutopilotSessions(context.Context, *ListAutopilotSessionsRequest) (*ListAutopilotSessionsResponse, error) + // litcli: `autopilot revoke` + // RevokeAutopilotSession revokes an Autopilot session. RevokeAutopilotSession(context.Context, *RevokeAutopilotSessionRequest) (*RevokeAutopilotSessionResponse, error) mustEmbedUnimplementedAutopilotServer() }