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.

56 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. int64 created_at = 8;
  12. }
  13. message Nothing {
  14. }
  15. message Domain {
  16. bytes start = 1;
  17. bytes end = 2;
  18. }
  19. message Iterator {
  20. Domain domain = 1;
  21. bool valid = 2;
  22. bytes key = 3;
  23. bytes value = 4;
  24. }
  25. message Stats {
  26. map<string, string> data = 1;
  27. int64 time_at = 2;
  28. }
  29. message Init {
  30. string Type = 1;
  31. string Name = 2;
  32. string Dir = 3;
  33. }
  34. service DB {
  35. rpc init(Init) returns (Entity) {}
  36. rpc get(Entity) returns (Entity) {}
  37. rpc getStream(stream Entity) returns (stream Entity) {}
  38. rpc has(Entity) returns (Entity) {}
  39. rpc set(Entity) returns (Nothing) {}
  40. rpc setSync(Entity) returns (Nothing) {}
  41. rpc delete(Entity) returns (Nothing) {}
  42. rpc deleteSync(Entity) returns (Nothing) {}
  43. rpc iterator(Entity) returns (stream Iterator) {}
  44. rpc reverseIterator(Entity) returns (stream Iterator) {}
  45. // rpc print(Nothing) returns (Entity) {}
  46. rpc stats(Nothing) returns (Stats) {}
  47. }