125 lines
2.3 KiB
Protocol Buffer
125 lines
2.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package bsync;
|
|
option go_package = "./;bsync";
|
|
|
|
//
|
|
// Sync
|
|
//
|
|
|
|
|
|
message MuteOperation {
|
|
enum Type {
|
|
TYPE_UNSPECIFIED = 0;
|
|
TYPE_ADD = 1;
|
|
TYPE_REMOVE = 2;
|
|
TYPE_CLEAR = 3;
|
|
}
|
|
string id = 1;
|
|
Type type = 2;
|
|
string actor_did = 3;
|
|
string subject = 4;
|
|
}
|
|
|
|
message AddMuteOperationRequest {
|
|
MuteOperation.Type type = 1;
|
|
string actor_did = 2;
|
|
string subject = 3;
|
|
}
|
|
|
|
message AddMuteOperationResponse {
|
|
MuteOperation operation = 1;
|
|
}
|
|
|
|
message ScanMuteOperationsRequest {
|
|
string cursor = 1;
|
|
int32 limit = 2;
|
|
}
|
|
|
|
message ScanMuteOperationsResponse {
|
|
repeated MuteOperation operations = 1;
|
|
string cursor = 2;
|
|
}
|
|
|
|
message NotifOperation {
|
|
string id = 1;
|
|
string actor_did = 2;
|
|
optional bool priority = 3;
|
|
}
|
|
|
|
message AddNotifOperationRequest {
|
|
string actor_did = 1;
|
|
optional bool priority = 2;
|
|
}
|
|
|
|
message AddNotifOperationResponse {
|
|
NotifOperation operation = 1;
|
|
}
|
|
|
|
message ScanNotifOperationsRequest {
|
|
string cursor = 1;
|
|
int32 limit = 2;
|
|
}
|
|
|
|
message ScanNotifOperationsResponse {
|
|
repeated NotifOperation operations = 1;
|
|
string cursor = 2;
|
|
}
|
|
|
|
|
|
enum Method {
|
|
METHOD_UNSPECIFIED = 0;
|
|
METHOD_CREATE = 1;
|
|
METHOD_UPDATE = 2;
|
|
METHOD_DELETE = 3;
|
|
}
|
|
|
|
message Operation {
|
|
string id = 1;
|
|
string actor_did = 2;
|
|
string namespace = 3;
|
|
string key = 4;
|
|
Method method = 5;
|
|
bytes payload = 6;
|
|
}
|
|
|
|
message PutOperationRequest {
|
|
string actor_did = 1;
|
|
string namespace = 2;
|
|
string key = 3;
|
|
Method method = 4;
|
|
bytes payload = 5;
|
|
}
|
|
|
|
message PutOperationResponse {
|
|
Operation operation = 1;
|
|
}
|
|
|
|
message ScanOperationsRequest {
|
|
string cursor = 1;
|
|
int32 limit = 2;
|
|
}
|
|
|
|
message ScanOperationsResponse {
|
|
repeated Operation operations = 1;
|
|
string cursor = 2;
|
|
}
|
|
|
|
|
|
// Ping
|
|
message PingRequest {}
|
|
message PingResponse {}
|
|
|
|
|
|
service Service {
|
|
// Sync
|
|
rpc AddMuteOperation(AddMuteOperationRequest) returns (AddMuteOperationResponse);
|
|
rpc ScanMuteOperations(ScanMuteOperationsRequest) returns (ScanMuteOperationsResponse);
|
|
rpc AddNotifOperation(AddNotifOperationRequest) returns (AddNotifOperationResponse);
|
|
rpc ScanNotifOperations(ScanNotifOperationsRequest) returns (ScanNotifOperationsResponse);
|
|
rpc PutOperation(PutOperationRequest) returns (PutOperationResponse);
|
|
rpc ScanOperations(ScanOperationsRequest) returns (ScanOperationsResponse);
|
|
// Ping
|
|
rpc Ping(PingRequest) returns (PingResponse);
|
|
}
|