-
Notifications
You must be signed in to change notification settings - Fork 1
/
service.proto
70 lines (56 loc) · 1.11 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
syntax = "proto3";
package lensv2;
service LensV2 {
rpc Index(IndexReq) returns (IndexResp) {}
rpc Search(SearchReq) returns (SearchResp) {}
rpc Remove(RemoveReq) returns (RemoveResp) {}
}
// INDEX
message IndexReq {
enum Type {
UNKNOWN = 0;
IPLD = 1;
}
Type type = 1;
string hash = 2;
string display_name = 3;
repeated string tags = 4;
message Options {
bool reindex = 1;
}
Options options = 5;
}
message IndexResp {
Document doc = 1;
}
// SEARCH
message SearchReq {
string query = 1;
message Options {
repeated string required = 1;
repeated string tags = 2;
repeated string categories = 3;
repeated string mime_types = 4;
repeated string hashes = 5;
}
Options options = 2;
}
message SearchResp {
message Result {
float score = 1;
Document doc = 2;
}
repeated Result results = 1;
}
message Document {
string hash = 1;
string display_name = 2;
string mime_type = 3;
string category = 4;
repeated string tags = 5;
}
// REMOVE
message RemoveReq {
string hash = 1;
}
message RemoveResp {}