memcache_service.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. syntax = "proto2";
  2. option go_package = "memcache";
  3. package appengine;
  4. message MemcacheServiceError {
  5. enum ErrorCode {
  6. OK = 0;
  7. UNSPECIFIED_ERROR = 1;
  8. NAMESPACE_NOT_SET = 2;
  9. PERMISSION_DENIED = 3;
  10. INVALID_VALUE = 6;
  11. }
  12. }
  13. message AppOverride {
  14. required string app_id = 1;
  15. optional int32 num_memcacheg_backends = 2 [deprecated=true];
  16. optional bool ignore_shardlock = 3 [deprecated=true];
  17. optional string memcache_pool_hint = 4 [deprecated=true];
  18. optional bytes memcache_sharding_strategy = 5 [deprecated=true];
  19. }
  20. message MemcacheGetRequest {
  21. repeated bytes key = 1;
  22. optional string name_space = 2 [default = ""];
  23. optional bool for_cas = 4;
  24. optional AppOverride override = 5;
  25. }
  26. message MemcacheGetResponse {
  27. repeated group Item = 1 {
  28. required bytes key = 2;
  29. required bytes value = 3;
  30. optional fixed32 flags = 4;
  31. optional fixed64 cas_id = 5;
  32. optional int32 expires_in_seconds = 6;
  33. }
  34. }
  35. message MemcacheSetRequest {
  36. enum SetPolicy {
  37. SET = 1;
  38. ADD = 2;
  39. REPLACE = 3;
  40. CAS = 4;
  41. }
  42. repeated group Item = 1 {
  43. required bytes key = 2;
  44. required bytes value = 3;
  45. optional fixed32 flags = 4;
  46. optional SetPolicy set_policy = 5 [default = SET];
  47. optional fixed32 expiration_time = 6 [default = 0];
  48. optional fixed64 cas_id = 8;
  49. optional bool for_cas = 9;
  50. }
  51. optional string name_space = 7 [default = ""];
  52. optional AppOverride override = 10;
  53. }
  54. message MemcacheSetResponse {
  55. enum SetStatusCode {
  56. STORED = 1;
  57. NOT_STORED = 2;
  58. ERROR = 3;
  59. EXISTS = 4;
  60. }
  61. repeated SetStatusCode set_status = 1;
  62. }
  63. message MemcacheDeleteRequest {
  64. repeated group Item = 1 {
  65. required bytes key = 2;
  66. optional fixed32 delete_time = 3 [default = 0];
  67. }
  68. optional string name_space = 4 [default = ""];
  69. optional AppOverride override = 5;
  70. }
  71. message MemcacheDeleteResponse {
  72. enum DeleteStatusCode {
  73. DELETED = 1;
  74. NOT_FOUND = 2;
  75. }
  76. repeated DeleteStatusCode delete_status = 1;
  77. }
  78. message MemcacheIncrementRequest {
  79. enum Direction {
  80. INCREMENT = 1;
  81. DECREMENT = 2;
  82. }
  83. required bytes key = 1;
  84. optional string name_space = 4 [default = ""];
  85. optional uint64 delta = 2 [default = 1];
  86. optional Direction direction = 3 [default = INCREMENT];
  87. optional uint64 initial_value = 5;
  88. optional fixed32 initial_flags = 6;
  89. optional AppOverride override = 7;
  90. }
  91. message MemcacheIncrementResponse {
  92. enum IncrementStatusCode {
  93. OK = 1;
  94. NOT_CHANGED = 2;
  95. ERROR = 3;
  96. }
  97. optional uint64 new_value = 1;
  98. optional IncrementStatusCode increment_status = 2;
  99. }
  100. message MemcacheBatchIncrementRequest {
  101. optional string name_space = 1 [default = ""];
  102. repeated MemcacheIncrementRequest item = 2;
  103. optional AppOverride override = 3;
  104. }
  105. message MemcacheBatchIncrementResponse {
  106. repeated MemcacheIncrementResponse item = 1;
  107. }
  108. message MemcacheFlushRequest {
  109. optional AppOverride override = 1;
  110. }
  111. message MemcacheFlushResponse {
  112. }
  113. message MemcacheStatsRequest {
  114. optional AppOverride override = 1;
  115. }
  116. message MergedNamespaceStats {
  117. required uint64 hits = 1;
  118. required uint64 misses = 2;
  119. required uint64 byte_hits = 3;
  120. required uint64 items = 4;
  121. required uint64 bytes = 5;
  122. required fixed32 oldest_item_age = 6;
  123. }
  124. message MemcacheStatsResponse {
  125. optional MergedNamespaceStats stats = 1;
  126. }
  127. message MemcacheGrabTailRequest {
  128. required int32 item_count = 1;
  129. optional string name_space = 2 [default = ""];
  130. optional AppOverride override = 3;
  131. }
  132. message MemcacheGrabTailResponse {
  133. repeated group Item = 1 {
  134. required bytes value = 2;
  135. optional fixed32 flags = 3;
  136. }
  137. }