-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.proto
46 lines (38 loc) · 886 Bytes
/
todo.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
syntax = "proto3";
import "google/protobuf/empty.proto";
message ToDo {
string id = 1;
string title = 2;
string description = 3;
bool done = 4;
}
message ToDoId {
string id = 1;
}
message OperationResult {
bool ok = 1;
int32 status = 2;
string message = 3;
string info = 4;
}
message PaginatedQueryParams {
int32 page = 1;
int32 size = 2;
}
message PaginatedQueryResult {
message PaginatedQueryResultRange {
int32 from = 1;
int32 to = 2;
}
int32 count = 1;
int32 total = 2;
PaginatedQueryResultRange range = 3;
repeated ToDo results = 4;
}
service Todo {
rpc Create (ToDo) returns (OperationResult);
rpc List (PaginatedQueryParams) returns (PaginatedQueryResult);
rpc ToggleDone (ToDoId) returns (OperationResult);
rpc Delete (ToDoId) returns (OperationResult);
rpc StreamList (google.protobuf.Empty) returns (stream ToDo);
}