syntax = "proto3";
|
|
|
|
package protodb;
|
|
|
|
message Entity {
|
|
int32 id = 1;
|
|
bytes key = 2;
|
|
bytes value = 3;
|
|
bool exists = 4;
|
|
bytes start = 5;
|
|
bytes end = 6;
|
|
string err = 7;
|
|
string print = 8;
|
|
int64 time_at = 9;
|
|
}
|
|
|
|
message Nothing {
|
|
}
|
|
|
|
message DDomain {
|
|
bytes start = 1;
|
|
bytes end = 2;
|
|
}
|
|
|
|
message Iterator {
|
|
DDomain domain = 1;
|
|
bool valid = 2;
|
|
bytes key = 3;
|
|
bytes value = 4;
|
|
}
|
|
|
|
message Stats {
|
|
map<string, string> data = 1;
|
|
int64 time_at = 2;
|
|
}
|
|
|
|
message Init {
|
|
string Type = 1;
|
|
string Name = 2;
|
|
string Dir = 3;
|
|
}
|
|
|
|
service DB {
|
|
rpc init(Init) returns (Entity) {}
|
|
rpc get(Entity) returns (Entity) {}
|
|
rpc getStream(stream Entity) returns (stream Entity) {}
|
|
|
|
rpc has(Entity) returns (Entity) {}
|
|
rpc set(Entity) returns (Nothing) {}
|
|
rpc setSync(Entity) returns (Nothing) {}
|
|
rpc delete(Entity) returns (Nothing) {}
|
|
rpc deleteSync(Entity) returns (Nothing) {}
|
|
rpc iterator(Entity) returns (stream Iterator) {}
|
|
rpc reverseIterator(Entity) returns (stream Iterator) {}
|
|
// rpc print(Nothing) returns (Entity) {}
|
|
rpc stats(Nothing) returns (Stats) {}
|
|
}
|