You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.1 KiB

  1. syntax = "proto3";
  2. package protodb;
  3. message Entity {
  4. int32 id = 1;
  5. bytes key = 2;
  6. bytes value = 3;
  7. bool exists = 4;
  8. bytes start = 5;
  9. bytes end = 6;
  10. string err = 7;
  11. string print = 8;
  12. int64 time_at = 9;
  13. }
  14. message Nothing {
  15. }
  16. message DDomain {
  17. bytes start = 1;
  18. bytes end = 2;
  19. }
  20. message Iterator {
  21. DDomain domain = 1;
  22. bool valid = 2;
  23. bytes key = 3;
  24. bytes value = 4;
  25. }
  26. message Stats {
  27. map<string, string> data = 1;
  28. int64 time_at = 2;
  29. }
  30. message Init {
  31. string Type = 1;
  32. string Name = 2;
  33. string Dir = 3;
  34. }
  35. service DB {
  36. rpc init(Init) returns (Entity) {}
  37. rpc get(Entity) returns (Entity) {}
  38. rpc getStream(stream Entity) returns (stream Entity) {}
  39. rpc has(Entity) returns (Entity) {}
  40. rpc set(Entity) returns (Nothing) {}
  41. rpc setSync(Entity) returns (Nothing) {}
  42. rpc delete(Entity) returns (Nothing) {}
  43. rpc deleteSync(Entity) returns (Nothing) {}
  44. rpc iterator(Entity) returns (stream Iterator) {}
  45. rpc reverseIterator(Entity) returns (stream Iterator) {}
  46. // rpc print(Nothing) returns (Entity) {}
  47. rpc stats(Nothing) returns (Stats) {}
  48. }