99 lines
2.4 KiB
Protocol Buffer
99 lines
2.4 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
||
|
|
package caretta_sync;
|
||
|
|
|
||
|
|
import "google/protobuf/timestamp.proto";
|
||
|
|
import "google/protobuf/duration.proto";
|
||
|
|
import "google/protobuf/empty.proto";
|
||
|
|
|
||
|
|
service CarettaSync {
|
||
|
|
rpc SendAuthorizationRequest(SendAuthorizationRequestRequest) returns (SendAuthorizationRequestResponse);
|
||
|
|
rpc AcceptAuthorizationRequest(AcceptAuthorizationRequestRequest) returns (AcceptAuthorizationRequestResponse);
|
||
|
|
rpc RejectAuthorizationRequest(RejectAuthorizationRequestRequest) returns (RejectAuthorizationRequestResponse);
|
||
|
|
rpc RemoteInfo(RemoteInfoRequest) returns (RemoteInfoResponse);
|
||
|
|
rpc RemoteInfoIter(RemoteInfoIterRequest) returns (stream RemoteInfoResponse);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
message RemoteInfoRequest {
|
||
|
|
PeerMessage peer = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RemoteInfoIterRequest {}
|
||
|
|
|
||
|
|
message RemoteInfoResponse {
|
||
|
|
oneof result {
|
||
|
|
RemoteInfoMessage remote_info = 1;
|
||
|
|
Error error = 2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message RemoteInfoMessage {
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|