forked from stephenh/ts-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batching.proto
50 lines (37 loc) · 957 Bytes
/
batching.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
syntax = "proto3";
package batching;
service EntityService {
rpc BatchQuery(BatchQueryRequest) returns (BatchQueryResponse);
rpc BatchMapQuery(BatchMapQueryRequest) returns (BatchMapQueryResponse);
// Add a method that is not batchable to show it's still cached
rpc GetOnlyMethod(GetOnlyMethodRequest) returns (GetOnlyMethodResponse);
// Add a method that won't get cached
rpc WriteMethod(WriteMethodRequest) returns (WriteMethodResponse);
}
message BatchQueryRequest {
repeated string ids = 1;
}
message BatchQueryResponse {
repeated Entity entities = 1;
}
message BatchMapQueryRequest {
repeated string ids = 1;
}
message BatchMapQueryResponse {
map<string, Entity> entities = 1;
}
message GetOnlyMethodRequest {
string id = 1;
}
message GetOnlyMethodResponse {
Entity entity = 1;
}
message WriteMethodRequest {
string id = 1;
}
message WriteMethodResponse {
}
message Entity {
string id = 1;
string name = 2;
}