-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.proto
57 lines (49 loc) · 992 Bytes
/
db.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
syntax = "proto3";
package lebai.db;
import "google/protobuf/empty.proto";
message SaveRequest {
string name = 1;
// 通用JSON数据
string data = 2;
string dir = 11;
}
message LoadRequest {
string name = 1;
string dir = 11;
}
message LoadResponse {
// 通用JSON数据
string data = 2;
}
message LoadListRequest {
string dir = 11;
}
message LoadListResponse {
// list of data name
repeated string names = 2;
}
message DeleteRequest {
string name = 1;
string dir = 11;
}
message Dir {
string name = 1;
// 内部ID,重命名后ID不变
uint32 id = 2;
}
message UpdateDirRequest {
string from = 1;
string to = 2;
}
message Dirs {
repeated Dir dirs = 1;
}
// 数据库存储相关服务
service DbService {
// 创建目录
rpc CreateDir(Dir) returns (google.protobuf.Empty);
// 目录重命名
rpc UpdateDir(UpdateDirRequest) returns (google.protobuf.Empty);
// 获取目录列表
rpc GetDirs(google.protobuf.Empty) returns (Dirs);
}