gamelang-jeopardy.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. syntax = "proto3";
  2. package gamelang;
  3. option go_package = "/gamelang/jeopardypb";
  4. message Challenge {
  5. uint32 id = 1;
  6. string description = 2;
  7. string clue = 3;
  8. string solution = 4;
  9. string url = 5;
  10. uint32 points = 6;
  11. bool checked = 7;
  12. repeated string checker = 8;
  13. repeated string moderators = 9;
  14. }
  15. message Category {
  16. uint32 id = 1;
  17. string name = 2;
  18. string description = 3;
  19. repeated Challenge challenges = 4;
  20. repeated string moderators = 5;
  21. }
  22. message Round {
  23. uint32 id = 1;
  24. string name = 2;
  25. string description = 3;
  26. repeated Category categories = 4;
  27. repeated uint32 curcats = 5;
  28. repeated string moderators = 6;
  29. }
  30. message Option {
  31. string key = 1;
  32. string value = 2;
  33. enum TypeEnum {
  34. STRING = 0;
  35. BOOL = 1;
  36. INT = 2;
  37. }
  38. TypeEnum type = 3;
  39. bool bool = 4;
  40. uint32 int = 5;
  41. }
  42. message Event {
  43. string type = 1;
  44. string game = 2;
  45. string value = 3;
  46. string gamename = 4;
  47. string username = 5;
  48. repeated string neighborgames = 6;
  49. }
  50. service EventService {
  51. rpc Inform (Event) returns (Event);
  52. }
  53. message Player {
  54. uint32 id = 1;
  55. enum type {
  56. SHOWMASTER = 0;
  57. CONTESTANT = 1;
  58. VIEWER = 2;
  59. }
  60. string name = 2;
  61. uint32 points = 3;
  62. }
  63. message Jeopardy {
  64. uint32 id = 1;
  65. string name = 2;
  66. repeated Option options = 3;
  67. repeated Round rounds = 4;
  68. uint32 curround = 5;
  69. repeated Player players = 6;
  70. bool started = 7;
  71. bool finished = 8;
  72. string winner = 9;
  73. repeated string moderators = 10;
  74. }
  75. service JeopardyService {
  76. rpc CreateJeopardy (Jeopardy) returns (Jeopardy);
  77. rpc UpdateJeopardy (Jeopardy) returns (Jeopardy);
  78. rpc DeleteJeopardy (Jeopardy) returns (Jeopardy);
  79. rpc GetJeopardy (Jeopardy) returns (Jeopardy);
  80. rpc ListJeopardy (Jeopardy) returns (stream Jeopardy);
  81. rpc CreateRound (Round) returns (Round);
  82. rpc UpdateRound (Round) returns (Round);
  83. rpc DeleteRound (Round) returns (Round);
  84. rpc GetRound (Round) returns (Round);
  85. rpc ListRound (Round) returns (stream Round);
  86. rpc CreateChallenge (Challenge) returns (Challenge);
  87. rpc UpdateChallenge (Challenge) returns (Challenge);
  88. rpc DeleteChallenge (Challenge) returns (Challenge);
  89. rpc GetChallenge (Challenge) returns (Challenge);
  90. rpc ListChallenge (Challenge) returns (stream Challenge);
  91. }