autopilotrpc: format autopilot.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to JSON in lncli and REST. The jsonpb has a setting to use the original name as defined in the proto file and the explicit json_name definition is not necessary any more. The jsonpb setting is called OrigName and needs to be true.
This commit is contained in:
parent
b99a457dd0
commit
bcfe92cee1
@ -167,7 +167,7 @@ var xxx_messageInfo_ModifyStatusResponse proto.InternalMessageInfo
|
|||||||
type QueryScoresRequest struct {
|
type QueryScoresRequest struct {
|
||||||
Pubkeys []string `protobuf:"bytes,1,rep,name=pubkeys,proto3" json:"pubkeys,omitempty"`
|
Pubkeys []string `protobuf:"bytes,1,rep,name=pubkeys,proto3" json:"pubkeys,omitempty"`
|
||||||
/// If set, we will ignore the local channel state when calculating scores.
|
/// If set, we will ignore the local channel state when calculating scores.
|
||||||
IgnoreLocalState bool `protobuf:"varint,2,opt,name=ignore_local_state,json=no_state,proto3" json:"ignore_local_state,omitempty"`
|
IgnoreLocalState bool `protobuf:"varint,2,opt,name=ignore_local_state,json=ignoreLocalState,proto3" json:"ignore_local_state,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
@ -397,36 +397,37 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("autopilotrpc/autopilot.proto", fileDescriptor_e0b9dc347a92e084) }
|
func init() { proto.RegisterFile("autopilotrpc/autopilot.proto", fileDescriptor_e0b9dc347a92e084) }
|
||||||
|
|
||||||
var fileDescriptor_e0b9dc347a92e084 = []byte{
|
var fileDescriptor_e0b9dc347a92e084 = []byte{
|
||||||
// 463 bytes of a gzipped FileDescriptorProto
|
// 468 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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2, 0x72, 0x2c, 0x64, 0xeb, 0x89, 0xd1, 0x79,
|
||||||
0x3c, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x4e, 0x74, 0x27, 0x7e, 0x04, 0x00, 0x00,
|
0x36, 0xeb, 0x94, 0xcf, 0xcc, 0x93, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xb6, 0x25, 0xd7,
|
||||||
|
0x86, 0x04, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
@ -11,68 +11,70 @@ service Autopilot {
|
|||||||
/**
|
/**
|
||||||
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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
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.
|
||||||
*/
|
*/
|
||||||
rpc ModifyStatus(ModifyStatusRequest) returns (ModifyStatusResponse);
|
rpc ModifyStatus (ModifyStatusRequest) returns (ModifyStatusResponse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
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.
|
||||||
*/
|
*/
|
||||||
rpc QueryScores(QueryScoresRequest) returns (QueryScoresResponse);
|
rpc QueryScores (QueryScoresRequest) returns (QueryScoresResponse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
SetScores attempts to set the scores used by the running autopilot agent,
|
SetScores attempts to set the scores used by the running autopilot agent,
|
||||||
if the external scoring heuristic is enabled.
|
if the external scoring heuristic is enabled.
|
||||||
*/
|
*/
|
||||||
rpc SetScores(SetScoresRequest) returns (SetScoresResponse);
|
rpc SetScores (SetScoresRequest) returns (SetScoresResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message StatusRequest{
|
message StatusRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message StatusResponse{
|
message StatusResponse {
|
||||||
/// Indicates whether the autopilot is active or not.
|
/// Indicates whether the autopilot is active or not.
|
||||||
bool active = 1 [json_name = "active"];
|
bool active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ModifyStatusRequest{
|
message ModifyStatusRequest {
|
||||||
/// Whether the autopilot agent should be enabled or not.
|
/// Whether the autopilot agent should be enabled or not.
|
||||||
bool enable = 1 [json_name = "enable"];
|
bool enable = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ModifyStatusResponse {}
|
message ModifyStatusResponse {
|
||||||
|
}
|
||||||
|
|
||||||
message QueryScoresRequest{
|
message QueryScoresRequest {
|
||||||
repeated string pubkeys = 1 [json_name = "pubkeys"];
|
repeated string pubkeys = 1;
|
||||||
|
|
||||||
/// If set, we will ignore the local channel state when calculating scores.
|
/// If set, we will ignore the local channel state when calculating scores.
|
||||||
bool ignore_local_state = 2 [json_name = "no_state"];
|
bool ignore_local_state = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message QueryScoresResponse {
|
message QueryScoresResponse {
|
||||||
message HeuristicResult {
|
message HeuristicResult {
|
||||||
string heuristic = 1 [json_name = "heuristic"];
|
string heuristic = 1;
|
||||||
map<string, double> scores= 2 [json_name = "scores"];
|
map<string, double> scores = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
repeated HeuristicResult results = 1 [json_name = "results"];
|
repeated HeuristicResult results = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetScoresRequest{
|
message SetScoresRequest {
|
||||||
/// The name of the heuristic to provide scores to.
|
/// The name of the heuristic to provide scores to.
|
||||||
string heuristic = 1 [json_name = "heuristic"];
|
string heuristic = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A map from hex-encoded public keys to scores. Scores must be in the range
|
A map from hex-encoded public keys to scores. Scores must be in the range
|
||||||
[0.0, 1.0].
|
[0.0, 1.0].
|
||||||
*/
|
*/
|
||||||
map<string, double> scores = 2 [json_name = "scores"];
|
map<string, double> scores = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetScoresResponse {}
|
message SetScoresResponse {
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user