kjuulh
4a91a564bf
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
93 lines
1.8 KiB
Protocol Buffer
93 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package hyperlog;
|
|
|
|
message UserGraphItem {
|
|
map<string, GraphItem> items = 1;
|
|
|
|
}
|
|
message SectionGraphItem {
|
|
map<string, GraphItem> items = 1;
|
|
}
|
|
|
|
message ItemStateNotDone {}
|
|
message ItemStateDone {}
|
|
|
|
message ItemGraphItem {
|
|
string title = 1;
|
|
string description = 2;
|
|
oneof item_state {
|
|
ItemStateNotDone not_done = 3;
|
|
ItemStateDone done = 4;
|
|
}
|
|
}
|
|
|
|
message GraphItem {
|
|
oneof contents {
|
|
UserGraphItem user = 1;
|
|
SectionGraphItem section = 2;
|
|
ItemGraphItem item = 3;
|
|
}
|
|
}
|
|
|
|
service Graph {
|
|
// Commands
|
|
rpc CreateSection(CreateSectionRequest) returns (CreateSectionResponse);
|
|
rpc CreateRoot(CreateRootRequest) returns (CreateRootResponse);
|
|
rpc CreateItem(CreateItemRequest) returns (CreateItemResponse);
|
|
rpc UpdateItem(UpdateItemRequest) returns (UpdateItemResponse);
|
|
rpc ToggleItem(ToggleItemRequest) returns (ToggleItemResponse);
|
|
|
|
// Queriers
|
|
rpc GetAvailableRoots(GetAvailableRootsRequest) returns (GetAvailableRootsResponse);
|
|
rpc Get(GetRequest) returns (GetReply);
|
|
|
|
}
|
|
|
|
// Commands
|
|
message CreateSectionRequest {
|
|
string root = 1;
|
|
repeated string path = 2;
|
|
}
|
|
message CreateSectionResponse {}
|
|
|
|
message CreateRootRequest {
|
|
string root = 1;
|
|
}
|
|
message CreateRootResponse {}
|
|
|
|
message CreateItemRequest {
|
|
string root = 1;
|
|
repeated string path = 2;
|
|
ItemGraphItem item = 3;
|
|
}
|
|
message CreateItemResponse {}
|
|
|
|
message UpdateItemRequest {
|
|
string root = 1;
|
|
repeated string path = 2;
|
|
ItemGraphItem item = 3;
|
|
}
|
|
message UpdateItemResponse {}
|
|
|
|
message ToggleItemRequest {
|
|
string root = 1;
|
|
repeated string path = 2;
|
|
}
|
|
message ToggleItemResponse {}
|
|
|
|
// Queries
|
|
message GetAvailableRootsRequest {}
|
|
message GetAvailableRootsResponse {
|
|
repeated string roots = 1;
|
|
}
|
|
|
|
message GetRequest {
|
|
string root = 1;
|
|
repeated string paths = 2;
|
|
}
|
|
|
|
message GetReply {
|
|
GraphItem item = 1;
|
|
}
|