-
Notifications
You must be signed in to change notification settings - Fork 0
/
dfs-service.proto
59 lines (45 loc) · 1.1 KB
/
dfs-service.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
syntax = "proto3";
package dfs_service;
import "google/protobuf/timestamp.proto";
service DFSService {
rpc Store (stream FileData) returns (FileAck);
rpc Fetch (FileName) returns (stream FileData);
rpc ListAll (EmptyRequest) returns (AllFiles);
rpc GetFileStatus (FileName) returns (FileStatus);
rpc GetLock (FileName) returns (WriteLock);
rpc CallbackList(FileName) returns (AllFiles);
rpc Delete (FileName) returns (FileAck);
}
message FileData {
string name = 1;
bytes data = 2;
uint32 crc = 3;
string client_id = 4;
uint64 mtime = 5;
}
message FileName {
string name = 1;
uint32 crc = 2;
string client_id = 3;
uint64 mtime = 4;
}
message FileAck {
string name = 1;
google.protobuf.Timestamp last_modified = 2;
uint32 crc = 3;
}
message AllFiles {
repeated FileStatus filestat = 1;
}
message FileStatus {
string name = 1;
uint64 size = 2;
google.protobuf.Timestamp created = 3;
google.protobuf.Timestamp last_modified = 4;
uint32 crc = 5;
}
message EmptyRequest {
string client_id = 1;
}
message WriteLock {
}