97 lines
2.1 KiB
Protocol Buffer
97 lines
2.1 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
||
|
|
package caretta_sync;
|
||
|
|
|
||
|
|
import "common.proto";
|
||
|
|
import "google/protobuf/timestamp.proto";
|
||
|
|
import "google/protobuf/duration.proto";
|
||
|
|
import "google/protobuf/empty.proto";
|
||
|
|
|
||
|
|
service PeerInfo {
|
||
|
|
rpc PeerInfo(PeerInfoRequest) returns (PeerInfoResponse);
|
||
|
|
rpc PeerInfoIter(PeerInfoIterRequest) returns (stream PeerInfoResponse);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
message PeerInfoRequest {
|
||
|
|
caretta_sync.common.PeerIdentifierMessage peer = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message PeerInfoIterRequest {}
|
||
|
|
|
||
|
|
message PeerInfoResponse {
|
||
|
|
oneof result {
|
||
|
|
PeerInfoMessage remote_info = 1;
|
||
|
|
Error error = 2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message PeerInfoMessage {
|
||
|
|
DoubleIdMessage id = 1;
|
||
|
|
PublicKeyMessage public_key = 2;
|
||
|
|
string relay_url = 3;
|
||
|
|
repeated DirectAddrInfoMessage addrs = 4;
|
||
|
|
string conn_type = 5;
|
||
|
|
google.protobuf.Duration latency = 6;
|
||
|
|
google.protobuf.Duration last_used = 7;
|
||
|
|
}
|
||
|
|
|
||
|
|
message DirectAddrInfoMessage {
|
||
|
|
string addr = 1;
|
||
|
|
google.protobuf.Duration latency = 2;
|
||
|
|
LastControlMessage last_control = 3;
|
||
|
|
google.protobuf.Duration last_payload = 4;
|
||
|
|
google.protobuf.Duration last_alive = 5;
|
||
|
|
repeated SourceMessage sources = 6;
|
||
|
|
}
|
||
|
|
|
||
|
|
message LastControlMessage {
|
||
|
|
google.protobuf.Duration duration = 1;
|
||
|
|
string control_msg = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message SourceMessage {
|
||
|
|
string source = 1;
|
||
|
|
google.protobuf.Duration duration = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message SendAuthorizationRequestRequest {
|
||
|
|
PeerMessage peer = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message SendAuthorizationRequestResponse {
|
||
|
|
oneof result {
|
||
|
|
string passcode = 1;
|
||
|
|
Error error = 2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message AuthorizationRequestMessage {
|
||
|
|
oneof authorization_request {
|
||
|
|
UuidMessage uuid = 1;
|
||
|
|
DoubleIdMessage id = 2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message AcceptAuthorizationRequestRequest {
|
||
|
|
AuthorizationRequestMessage authorization_request = 1;
|
||
|
|
string passcode = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message AcceptAuthorizationRequestResponse {
|
||
|
|
oneof result {
|
||
|
|
google.protobuf.Empty ok = 1;
|
||
|
|
Error error = 2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message RejectAuthorizationRequestRequest {
|
||
|
|
AuthorizationRequestMessage authorization_request = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RejectAuthorizationRequestResponse {
|
||
|
|
oneof result {
|
||
|
|
google.protobuf.Empty ok = 1;
|
||
|
|
Error error = 2;
|
||
|
|
}
|
||
|
|
}
|