-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-example.proto
More file actions
116 lines (79 loc) · 1.99 KB
/
api-example.proto
File metadata and controls
116 lines (79 loc) · 1.99 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
syntax = "proto3";
service FileService {
rpc GetInfo (FileInfoRequest) returns (FileInfoResponse) {}
rpc ListChildren (ListChildrenRequest) returns (stream FileInfo) {}
rpc CreateEmptyFile (CreateEmptyFileRequest) returns (CreateEmptyFileResponse) {}
rpc CreateEmptyDir (CreateEmptyDirRequest) returns (CreateEmptyDirResponse) {}
rpc Delete (DeleteRequest) returns (DeleteResponse) {}
rpc Move (MoveRequest) returns (MoveResponse) {}
rpc Copy (CopyRequest) returns (CopyResponse) {}
rpc Append (AppendRequest) returns (AppendResponse) {}
rpc Read (ReadRequest) returns (stream ReadChunk) {}
}
//------------------ info ------------------
message FileInfoRequest {
string path = 1;
}
message FileInfoResponse {
FileInfo info = 1;
}
//------------------ list -------------------
message ListChildrenRequest {
string path = 1;
}
//------------------ create file ------------
message CreateEmptyFileRequest {
string path = 1;
}
message CreateEmptyFileResponse {
FileInfo info = 1;
}
//------------------ create dir --------------
message CreateEmptyDirRequest {
string path = 1;
}
message CreateEmptyDirResponse {
FileInfo info = 1;
}
//------------------ delete ------------------
message DeleteRequest {
string path = 1;
}
message DeleteResponse {
}
//------------------ move --------------------
message MoveRequest {
string srcPath = 1;
string dstPath = 2;
}
message MoveResponse {
}
//------------------ copy --------------------
message CopyRequest {
string srcPath = 1;
string dstPath = 2;
}
message CopyResponse {
}
//------------------ append ------------------
message AppendRequest {
string path = 1;
bytes content = 2;
}
message AppendResponse {
}
//------------------ read --------------------
message ReadRequest {
string path = 1;
int64 offset = 2;
int64 length = 3;
}
message ReadChunk {
bytes content = 1;
}
//------------------ common ------------------
message FileInfo {
string name = 1;
string path = 2;
int64 size = 3;
}