momento 0.1.0 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.release-please-manifest.json +3 -0
  3. data/.rubocop.yml +26 -1
  4. data/.ruby-version +1 -1
  5. data/.yardopts +2 -0
  6. data/CHANGELOG.md +119 -0
  7. data/CONTRIBUTING.md +6 -7
  8. data/Gemfile +1 -6
  9. data/Gemfile.lock +34 -24
  10. data/README.md +143 -38
  11. data/README.template.md +93 -0
  12. data/examples/.gitignore +1 -0
  13. data/examples/Gemfile +5 -0
  14. data/examples/README.md +34 -0
  15. data/examples/compact.rb +47 -0
  16. data/examples/example.rb +72 -0
  17. data/examples/file.rb +58 -0
  18. data/lib/README-generating-pb.txt +1 -1
  19. data/lib/momento/auth/credential_provider.rb +78 -0
  20. data/lib/momento/cache_client.rb +457 -0
  21. data/lib/momento/collection_ttl.rb +79 -0
  22. data/lib/momento/config/configuration.rb +16 -0
  23. data/lib/momento/config/configurations.rb +17 -0
  24. data/lib/momento/config/transport/grpc_configuration.rb +25 -0
  25. data/lib/momento/config/transport/static_transport_strategy.rb +12 -0
  26. data/lib/momento/config/transport/transport_strategy.rb +16 -0
  27. data/lib/momento/error/grpc_details.rb +38 -0
  28. data/lib/momento/error/transport_details.rb +20 -0
  29. data/lib/momento/error/types.rb +247 -0
  30. data/lib/momento/error.rb +54 -0
  31. data/lib/momento/error_builder.rb +50 -0
  32. data/lib/momento/exceptions.rb +7 -0
  33. data/lib/momento/generated/README.md +16 -0
  34. data/lib/momento/generated/auth_pb.rb +52 -0
  35. data/lib/momento/generated/auth_services_pb.rb +27 -0
  36. data/lib/momento/generated/cacheclient_pb.rb +203 -0
  37. data/lib/momento/generated/cacheclient_services_pb.rb +90 -0
  38. data/lib/momento/generated/cacheping_pb.rb +38 -0
  39. data/lib/momento/generated/cacheping_services_pb.rb +23 -0
  40. data/lib/momento/generated/cachepubsub_pb.rb +48 -0
  41. data/lib/momento/generated/cachepubsub_services_pb.rb +56 -0
  42. data/lib/momento/generated/common_pb.rb +44 -0
  43. data/lib/momento/generated/controlclient_pb.rb +72 -0
  44. data/lib/momento/generated/controlclient_services_pb.rb +35 -0
  45. data/lib/momento/generated/extensions_pb.rb +35 -0
  46. data/lib/momento/generated/generate_protos.sh +47 -0
  47. data/lib/momento/generated/leaderboard_pb.rb +56 -0
  48. data/lib/momento/generated/leaderboard_services_pb.rb +57 -0
  49. data/lib/momento/generated/permissionmessages_pb.rb +48 -0
  50. data/lib/momento/generated/token_pb.rb +43 -0
  51. data/lib/momento/generated/token_services_pb.rb +23 -0
  52. data/lib/momento/generated/webhook_pb.rb +49 -0
  53. data/lib/momento/generated/webhook_services_pb.rb +32 -0
  54. data/lib/momento/{create_cache_response.rb → response/control/create_cache_response.rb} +33 -24
  55. data/lib/momento/{delete_cache_response.rb → response/control/delete_cache_response.rb} +28 -21
  56. data/lib/momento/response/control/list_caches_response.rb +80 -0
  57. data/lib/momento/response/delete_response.rb +45 -0
  58. data/lib/momento/response/error.rb +10 -3
  59. data/lib/momento/response/get_response.rb +107 -0
  60. data/lib/momento/response/response.rb +67 -0
  61. data/lib/momento/response/response_builder.rb +18 -0
  62. data/lib/momento/response/set_response.rb +59 -0
  63. data/lib/momento/response/sort_order.rb +11 -0
  64. data/lib/momento/response/sorted_set/sorted_set_fetch_response.rb +107 -0
  65. data/lib/momento/response/sorted_set/sorted_set_put_element_response.rb +44 -0
  66. data/lib/momento/response/sorted_set/sorted_set_put_elements_response.rb +44 -0
  67. data/lib/momento/ttl.rb +48 -0
  68. data/lib/momento/version.rb +2 -1
  69. data/lib/momento.rb +6 -1
  70. data/momento.gemspec +6 -3
  71. data/release-please-config.json +15 -0
  72. data/sig/momento/auth/credential_provider.rbs +11 -0
  73. data/sig/momento/cache_client.rbs +12 -0
  74. data/sig/momento/collection_ttl.rbs +22 -0
  75. data/sig/momento/config/configuration.rbs +9 -0
  76. data/sig/momento/config/configurations.rbs +9 -0
  77. data/sig/momento/config/transport/grpc_configuration.rbs +7 -0
  78. data/sig/momento/config/transport/transport_strategy.rbs +7 -0
  79. data/sig/momento/list_caches_response.rbs +7 -0
  80. data/sig/momento/sorted_set_fetch_response.rbs +13 -0
  81. data/sig/momento/sorted_set_put_element_response.rbs +5 -0
  82. data/sig/momento/sorted_set_put_elements_response.rbs +5 -0
  83. metadata +127 -28
  84. data/examples/basic.rb +0 -45
  85. data/lib/momento/cacheclient_pb.rb +0 -332
  86. data/lib/momento/cacheclient_services_pb.rb +0 -42
  87. data/lib/momento/controlclient_pb.rb +0 -71
  88. data/lib/momento/controlclient_services_pb.rb +0 -29
  89. data/lib/momento/delete_response.rb +0 -33
  90. data/lib/momento/get_response.rb +0 -80
  91. data/lib/momento/list_caches_response.rb +0 -53
  92. data/lib/momento/response.rb +0 -17
  93. data/lib/momento/set_response.rb +0 -39
  94. data/lib/momento/simple_cache_client.rb +0 -204
@@ -1,332 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: cacheclient.proto
3
-
4
- require 'google/protobuf'
5
-
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("cacheclient.proto", :syntax => :proto3) do
8
- add_message "cache_client._GetRequest" do
9
- optional :cache_key, :bytes, 1
10
- end
11
- add_message "cache_client._GetResponse" do
12
- optional :result, :enum, 1, "cache_client.ECacheResult"
13
- optional :cache_body, :bytes, 2
14
- optional :message, :string, 3
15
- end
16
- add_message "cache_client._DeleteRequest" do
17
- optional :cache_key, :bytes, 1
18
- end
19
- add_message "cache_client._DeleteResponse" do
20
- end
21
- add_message "cache_client._SetRequest" do
22
- optional :cache_key, :bytes, 1
23
- optional :cache_body, :bytes, 2
24
- optional :ttl_milliseconds, :uint64, 3
25
- end
26
- add_message "cache_client._SetResponse" do
27
- optional :result, :enum, 1, "cache_client.ECacheResult"
28
- optional :message, :string, 2
29
- end
30
- add_message "cache_client._DictionaryGetRequest" do
31
- optional :dictionary_name, :bytes, 1
32
- repeated :fields, :bytes, 2
33
- end
34
- add_message "cache_client._DictionaryGetResponse" do
35
- oneof :dictionary do
36
- optional :found, :message, 1, "cache_client._DictionaryGetResponse._Found"
37
- optional :missing, :message, 2, "cache_client._DictionaryGetResponse._Missing"
38
- end
39
- end
40
- add_message "cache_client._DictionaryGetResponse._DictionaryGetResponsePart" do
41
- optional :result, :enum, 1, "cache_client.ECacheResult"
42
- optional :cache_body, :bytes, 2
43
- end
44
- add_message "cache_client._DictionaryGetResponse._Found" do
45
- repeated :items, :message, 1, "cache_client._DictionaryGetResponse._DictionaryGetResponsePart"
46
- end
47
- add_message "cache_client._DictionaryGetResponse._Missing" do
48
- end
49
- add_message "cache_client._DictionaryFetchRequest" do
50
- optional :dictionary_name, :bytes, 1
51
- end
52
- add_message "cache_client._DictionaryFieldValuePair" do
53
- optional :field, :bytes, 1
54
- optional :value, :bytes, 2
55
- end
56
- add_message "cache_client._DictionaryFetchResponse" do
57
- oneof :dictionary do
58
- optional :found, :message, 1, "cache_client._DictionaryFetchResponse._Found"
59
- optional :missing, :message, 2, "cache_client._DictionaryFetchResponse._Missing"
60
- end
61
- end
62
- add_message "cache_client._DictionaryFetchResponse._Found" do
63
- repeated :items, :message, 1, "cache_client._DictionaryFieldValuePair"
64
- end
65
- add_message "cache_client._DictionaryFetchResponse._Missing" do
66
- end
67
- add_message "cache_client._DictionarySetRequest" do
68
- optional :dictionary_name, :bytes, 1
69
- repeated :items, :message, 2, "cache_client._DictionaryFieldValuePair"
70
- optional :ttl_milliseconds, :uint64, 3
71
- optional :refresh_ttl, :bool, 4
72
- end
73
- add_message "cache_client._DictionarySetResponse" do
74
- end
75
- add_message "cache_client._DictionaryIncrementRequest" do
76
- optional :dictionary_name, :bytes, 1
77
- optional :field, :bytes, 2
78
- optional :amount, :int64, 3
79
- optional :ttl_milliseconds, :uint64, 4
80
- optional :refresh_ttl, :bool, 5
81
- end
82
- add_message "cache_client._DictionaryIncrementResponse" do
83
- optional :value, :int64, 1
84
- end
85
- add_message "cache_client._DictionaryDeleteRequest" do
86
- optional :dictionary_name, :bytes, 1
87
- oneof :delete do
88
- optional :some, :message, 2, "cache_client._DictionaryDeleteRequest.Some"
89
- optional :all, :message, 3, "cache_client._DictionaryDeleteRequest.All"
90
- end
91
- end
92
- add_message "cache_client._DictionaryDeleteRequest.Some" do
93
- repeated :fields, :bytes, 1
94
- end
95
- add_message "cache_client._DictionaryDeleteRequest.All" do
96
- end
97
- add_message "cache_client._DictionaryDeleteResponse" do
98
- end
99
- add_message "cache_client._SetFetchRequest" do
100
- optional :set_name, :bytes, 1
101
- end
102
- add_message "cache_client._SetFetchResponse" do
103
- oneof :set do
104
- optional :found, :message, 1, "cache_client._SetFetchResponse._Found"
105
- optional :missing, :message, 2, "cache_client._SetFetchResponse._Missing"
106
- end
107
- end
108
- add_message "cache_client._SetFetchResponse._Found" do
109
- repeated :elements, :bytes, 1
110
- end
111
- add_message "cache_client._SetFetchResponse._Missing" do
112
- end
113
- add_message "cache_client._SetUnionRequest" do
114
- optional :set_name, :bytes, 1
115
- repeated :elements, :bytes, 2
116
- optional :ttl_milliseconds, :uint64, 3
117
- optional :refresh_ttl, :bool, 4
118
- end
119
- add_message "cache_client._SetUnionResponse" do
120
- end
121
- add_message "cache_client._SetDifferenceRequest" do
122
- optional :set_name, :bytes, 1
123
- oneof :difference do
124
- optional :minuend, :message, 2, "cache_client._SetDifferenceRequest._Minuend"
125
- optional :subtrahend, :message, 3, "cache_client._SetDifferenceRequest._Subtrahend"
126
- end
127
- end
128
- add_message "cache_client._SetDifferenceRequest._Minuend" do
129
- repeated :elements, :bytes, 1
130
- end
131
- add_message "cache_client._SetDifferenceRequest._Subtrahend" do
132
- oneof :subtrahend_set do
133
- optional :set, :message, 1, "cache_client._SetDifferenceRequest._Subtrahend._Set"
134
- optional :identity, :message, 2, "cache_client._SetDifferenceRequest._Subtrahend._Identity"
135
- end
136
- end
137
- add_message "cache_client._SetDifferenceRequest._Subtrahend._Set" do
138
- repeated :elements, :bytes, 1
139
- end
140
- add_message "cache_client._SetDifferenceRequest._Subtrahend._Identity" do
141
- end
142
- add_message "cache_client._SetDifferenceResponse" do
143
- oneof :set do
144
- optional :found, :message, 1, "cache_client._SetDifferenceResponse._Found"
145
- optional :missing, :message, 2, "cache_client._SetDifferenceResponse._Missing"
146
- end
147
- end
148
- add_message "cache_client._SetDifferenceResponse._Found" do
149
- end
150
- add_message "cache_client._SetDifferenceResponse._Missing" do
151
- end
152
- add_message "cache_client._ListPushFrontRequest" do
153
- optional :list_name, :bytes, 1
154
- optional :value, :bytes, 2
155
- optional :ttl_milliseconds, :uint64, 3
156
- optional :refresh_ttl, :bool, 4
157
- proto3_optional :truncate_back_to_size, :uint32, 5
158
- end
159
- add_message "cache_client._ListPushFrontResponse" do
160
- optional :list_length, :uint32, 1
161
- end
162
- add_message "cache_client._ListPushBackRequest" do
163
- optional :list_name, :bytes, 1
164
- optional :value, :bytes, 2
165
- optional :ttl_milliseconds, :uint64, 3
166
- optional :refresh_ttl, :bool, 4
167
- proto3_optional :truncate_front_to_size, :uint32, 5
168
- end
169
- add_message "cache_client._ListPushBackResponse" do
170
- optional :list_length, :uint32, 1
171
- end
172
- add_message "cache_client._ListPopFrontRequest" do
173
- optional :list_name, :bytes, 1
174
- end
175
- add_message "cache_client._ListPopFrontResponse" do
176
- oneof :list do
177
- optional :found, :message, 1, "cache_client._ListPopFrontResponse._Found"
178
- optional :missing, :message, 2, "cache_client._ListPopFrontResponse._Missing"
179
- end
180
- end
181
- add_message "cache_client._ListPopFrontResponse._Found" do
182
- optional :front, :bytes, 1
183
- end
184
- add_message "cache_client._ListPopFrontResponse._Missing" do
185
- end
186
- add_message "cache_client._ListPopBackRequest" do
187
- optional :list_name, :bytes, 1
188
- end
189
- add_message "cache_client._ListPopBackResponse" do
190
- oneof :list do
191
- optional :found, :message, 1, "cache_client._ListPopBackResponse._Found"
192
- optional :missing, :message, 2, "cache_client._ListPopBackResponse._Missing"
193
- end
194
- end
195
- add_message "cache_client._ListPopBackResponse._Found" do
196
- optional :back, :bytes, 1
197
- end
198
- add_message "cache_client._ListPopBackResponse._Missing" do
199
- end
200
- add_message "cache_client._ListRange" do
201
- optional :begin_index, :uint32, 1
202
- optional :count, :uint32, 2
203
- end
204
- add_message "cache_client._ListEraseRequest" do
205
- optional :list_name, :bytes, 1
206
- oneof :erase do
207
- optional :some, :message, 2, "cache_client._ListEraseRequest._ListRanges"
208
- optional :all, :message, 3, "cache_client._ListEraseRequest._All"
209
- end
210
- end
211
- add_message "cache_client._ListEraseRequest._All" do
212
- end
213
- add_message "cache_client._ListEraseRequest._ListRanges" do
214
- repeated :ranges, :message, 1, "cache_client._ListRange"
215
- end
216
- add_message "cache_client._ListEraseResponse" do
217
- end
218
- add_message "cache_client._ListRemoveRequest" do
219
- optional :list_name, :bytes, 1
220
- oneof :remove do
221
- optional :all_elements_with_value, :bytes, 2
222
- end
223
- end
224
- add_message "cache_client._ListRemoveResponse" do
225
- end
226
- add_message "cache_client._ListFetchRequest" do
227
- optional :list_name, :bytes, 1
228
- end
229
- add_message "cache_client._ListFetchResponse" do
230
- oneof :list do
231
- optional :found, :message, 1, "cache_client._ListFetchResponse._Found"
232
- optional :missing, :message, 2, "cache_client._ListFetchResponse._Missing"
233
- end
234
- end
235
- add_message "cache_client._ListFetchResponse._Found" do
236
- repeated :values, :bytes, 1
237
- end
238
- add_message "cache_client._ListFetchResponse._Missing" do
239
- end
240
- add_message "cache_client._ListLengthRequest" do
241
- optional :list_name, :bytes, 1
242
- end
243
- add_message "cache_client._ListLengthResponse" do
244
- oneof :list do
245
- optional :found, :message, 1, "cache_client._ListLengthResponse._Found"
246
- optional :missing, :message, 2, "cache_client._ListLengthResponse._Missing"
247
- end
248
- end
249
- add_message "cache_client._ListLengthResponse._Found" do
250
- optional :length, :uint32, 1
251
- end
252
- add_message "cache_client._ListLengthResponse._Missing" do
253
- end
254
- add_enum "cache_client.ECacheResult" do
255
- value :Invalid, 0
256
- value :Ok, 1
257
- value :Hit, 2
258
- value :Miss, 3
259
- end
260
- end
261
- end
262
-
263
- module Momento
264
- module CacheClient
265
- GetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._GetRequest").msgclass
266
- GetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._GetResponse").msgclass
267
- DeleteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DeleteRequest").msgclass
268
- DeleteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DeleteResponse").msgclass
269
- SetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetRequest").msgclass
270
- SetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetResponse").msgclass
271
- DictionaryGetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryGetRequest").msgclass
272
- DictionaryGetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryGetResponse").msgclass
273
- DictionaryGetResponse::DictionaryGetResponsePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryGetResponse._DictionaryGetResponsePart").msgclass
274
- DictionaryGetResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryGetResponse._Found").msgclass
275
- DictionaryGetResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryGetResponse._Missing").msgclass
276
- DictionaryFetchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryFetchRequest").msgclass
277
- DictionaryFieldValuePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryFieldValuePair").msgclass
278
- DictionaryFetchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryFetchResponse").msgclass
279
- DictionaryFetchResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryFetchResponse._Found").msgclass
280
- DictionaryFetchResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryFetchResponse._Missing").msgclass
281
- DictionarySetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionarySetRequest").msgclass
282
- DictionarySetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionarySetResponse").msgclass
283
- DictionaryIncrementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryIncrementRequest").msgclass
284
- DictionaryIncrementResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryIncrementResponse").msgclass
285
- DictionaryDeleteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryDeleteRequest").msgclass
286
- DictionaryDeleteRequest::Some = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryDeleteRequest.Some").msgclass
287
- DictionaryDeleteRequest::All = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryDeleteRequest.All").msgclass
288
- DictionaryDeleteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._DictionaryDeleteResponse").msgclass
289
- SetFetchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetFetchRequest").msgclass
290
- SetFetchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetFetchResponse").msgclass
291
- SetFetchResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetFetchResponse._Found").msgclass
292
- SetFetchResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetFetchResponse._Missing").msgclass
293
- SetUnionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetUnionRequest").msgclass
294
- SetUnionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetUnionResponse").msgclass
295
- SetDifferenceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceRequest").msgclass
296
- SetDifferenceRequest::Minuend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceRequest._Minuend").msgclass
297
- SetDifferenceRequest::Subtrahend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceRequest._Subtrahend").msgclass
298
- SetDifferenceRequest::Subtrahend::Set = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceRequest._Subtrahend._Set").msgclass
299
- SetDifferenceRequest::Subtrahend::Identity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceRequest._Subtrahend._Identity").msgclass
300
- SetDifferenceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceResponse").msgclass
301
- SetDifferenceResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceResponse._Found").msgclass
302
- SetDifferenceResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._SetDifferenceResponse._Missing").msgclass
303
- ListPushFrontRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPushFrontRequest").msgclass
304
- ListPushFrontResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPushFrontResponse").msgclass
305
- ListPushBackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPushBackRequest").msgclass
306
- ListPushBackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPushBackResponse").msgclass
307
- ListPopFrontRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopFrontRequest").msgclass
308
- ListPopFrontResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopFrontResponse").msgclass
309
- ListPopFrontResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopFrontResponse._Found").msgclass
310
- ListPopFrontResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopFrontResponse._Missing").msgclass
311
- ListPopBackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopBackRequest").msgclass
312
- ListPopBackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopBackResponse").msgclass
313
- ListPopBackResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopBackResponse._Found").msgclass
314
- ListPopBackResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListPopBackResponse._Missing").msgclass
315
- ListRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListRange").msgclass
316
- ListEraseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListEraseRequest").msgclass
317
- ListEraseRequest::All = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListEraseRequest._All").msgclass
318
- ListEraseRequest::ListRanges = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListEraseRequest._ListRanges").msgclass
319
- ListEraseResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListEraseResponse").msgclass
320
- ListRemoveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListRemoveRequest").msgclass
321
- ListRemoveResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListRemoveResponse").msgclass
322
- ListFetchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListFetchRequest").msgclass
323
- ListFetchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListFetchResponse").msgclass
324
- ListFetchResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListFetchResponse._Found").msgclass
325
- ListFetchResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListFetchResponse._Missing").msgclass
326
- ListLengthRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListLengthRequest").msgclass
327
- ListLengthResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListLengthResponse").msgclass
328
- ListLengthResponse::Found = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListLengthResponse._Found").msgclass
329
- ListLengthResponse::Missing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client._ListLengthResponse._Missing").msgclass
330
- ECacheResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("cache_client.ECacheResult").enummodule
331
- end
332
- end
@@ -1,42 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: cacheclient.proto for package 'cache_client'
3
-
4
- require 'grpc'
5
- require_relative 'cacheclient_pb'
6
-
7
- module Momento
8
- module CacheClient
9
- module Scs
10
- class Service
11
-
12
- include ::GRPC::GenericService
13
-
14
- self.marshal_class_method = :encode
15
- self.unmarshal_class_method = :decode
16
- self.service_name = 'cache_client.Scs'
17
-
18
- rpc :Get, ::Momento::CacheClient::GetRequest, ::Momento::CacheClient::GetResponse
19
- rpc :Set, ::Momento::CacheClient::SetRequest, ::Momento::CacheClient::SetResponse
20
- rpc :Delete, ::Momento::CacheClient::DeleteRequest, ::Momento::CacheClient::DeleteResponse
21
- rpc :DictionaryGet, ::Momento::CacheClient::DictionaryGetRequest, ::Momento::CacheClient::DictionaryGetResponse
22
- rpc :DictionaryFetch, ::Momento::CacheClient::DictionaryFetchRequest, ::Momento::CacheClient::DictionaryFetchResponse
23
- rpc :DictionarySet, ::Momento::CacheClient::DictionarySetRequest, ::Momento::CacheClient::DictionarySetResponse
24
- rpc :DictionaryIncrement, ::Momento::CacheClient::DictionaryIncrementRequest, ::Momento::CacheClient::DictionaryIncrementResponse
25
- rpc :DictionaryDelete, ::Momento::CacheClient::DictionaryDeleteRequest, ::Momento::CacheClient::DictionaryDeleteResponse
26
- rpc :SetFetch, ::Momento::CacheClient::SetFetchRequest, ::Momento::CacheClient::SetFetchResponse
27
- rpc :SetUnion, ::Momento::CacheClient::SetUnionRequest, ::Momento::CacheClient::SetUnionResponse
28
- rpc :SetDifference, ::Momento::CacheClient::SetDifferenceRequest, ::Momento::CacheClient::SetDifferenceResponse
29
- rpc :ListPushFront, ::Momento::CacheClient::ListPushFrontRequest, ::Momento::CacheClient::ListPushFrontResponse
30
- rpc :ListPushBack, ::Momento::CacheClient::ListPushBackRequest, ::Momento::CacheClient::ListPushBackResponse
31
- rpc :ListPopFront, ::Momento::CacheClient::ListPopFrontRequest, ::Momento::CacheClient::ListPopFrontResponse
32
- rpc :ListPopBack, ::Momento::CacheClient::ListPopBackRequest, ::Momento::CacheClient::ListPopBackResponse
33
- rpc :ListErase, ::Momento::CacheClient::ListEraseRequest, ::Momento::CacheClient::ListEraseResponse
34
- rpc :ListRemove, ::Momento::CacheClient::ListRemoveRequest, ::Momento::CacheClient::ListRemoveResponse
35
- rpc :ListFetch, ::Momento::CacheClient::ListFetchRequest, ::Momento::CacheClient::ListFetchResponse
36
- rpc :ListLength, ::Momento::CacheClient::ListLengthRequest, ::Momento::CacheClient::ListLengthResponse
37
- end
38
-
39
- Stub = Service.rpc_stub_class
40
- end
41
- end
42
- end
@@ -1,71 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: controlclient.proto
3
-
4
- require 'google/protobuf'
5
-
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("controlclient.proto", :syntax => :proto3) do
8
- add_message "control_client._DeleteCacheRequest" do
9
- optional :cache_name, :string, 1
10
- end
11
- add_message "control_client._DeleteCacheResponse" do
12
- end
13
- add_message "control_client._CreateCacheRequest" do
14
- optional :cache_name, :string, 1
15
- end
16
- add_message "control_client._CreateCacheResponse" do
17
- end
18
- add_message "control_client._ListCachesRequest" do
19
- optional :next_token, :string, 1
20
- end
21
- add_message "control_client._Cache" do
22
- optional :cache_name, :string, 1
23
- end
24
- add_message "control_client._ListCachesResponse" do
25
- repeated :cache, :message, 1, "control_client._Cache"
26
- optional :next_token, :string, 2
27
- end
28
- add_message "control_client._CreateSigningKeyRequest" do
29
- optional :ttl_minutes, :uint32, 1
30
- end
31
- add_message "control_client._CreateSigningKeyResponse" do
32
- optional :key, :string, 1
33
- optional :expires_at, :uint64, 2
34
- end
35
- add_message "control_client._RevokeSigningKeyRequest" do
36
- optional :key_id, :string, 1
37
- end
38
- add_message "control_client._RevokeSigningKeyResponse" do
39
- end
40
- add_message "control_client._SigningKey" do
41
- optional :key_id, :string, 1
42
- optional :expires_at, :uint64, 2
43
- end
44
- add_message "control_client._ListSigningKeysRequest" do
45
- optional :next_token, :string, 1
46
- end
47
- add_message "control_client._ListSigningKeysResponse" do
48
- repeated :signing_key, :message, 1, "control_client._SigningKey"
49
- optional :next_token, :string, 2
50
- end
51
- end
52
- end
53
-
54
- module Momento
55
- module ControlClient
56
- DeleteCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._DeleteCacheRequest").msgclass
57
- DeleteCacheResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._DeleteCacheResponse").msgclass
58
- CreateCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._CreateCacheRequest").msgclass
59
- CreateCacheResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._CreateCacheResponse").msgclass
60
- ListCachesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._ListCachesRequest").msgclass
61
- Cache = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._Cache").msgclass
62
- ListCachesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._ListCachesResponse").msgclass
63
- CreateSigningKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._CreateSigningKeyRequest").msgclass
64
- CreateSigningKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._CreateSigningKeyResponse").msgclass
65
- RevokeSigningKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._RevokeSigningKeyRequest").msgclass
66
- RevokeSigningKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._RevokeSigningKeyResponse").msgclass
67
- SigningKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._SigningKey").msgclass
68
- ListSigningKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._ListSigningKeysRequest").msgclass
69
- ListSigningKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("control_client._ListSigningKeysResponse").msgclass
70
- end
71
- end
@@ -1,29 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: controlclient.proto for package 'control_client'
3
-
4
- require 'grpc'
5
- require_relative 'controlclient_pb'
6
-
7
- module Momento
8
- module ControlClient
9
- module ScsControl
10
- class Service
11
-
12
- include ::GRPC::GenericService
13
-
14
- self.marshal_class_method = :encode
15
- self.unmarshal_class_method = :decode
16
- self.service_name = 'control_client.ScsControl'
17
-
18
- rpc :CreateCache, ::Momento::ControlClient::CreateCacheRequest, ::Momento::ControlClient::CreateCacheResponse
19
- rpc :DeleteCache, ::Momento::ControlClient::DeleteCacheRequest, ::Momento::ControlClient::DeleteCacheResponse
20
- rpc :ListCaches, ::Momento::ControlClient::ListCachesRequest, ::Momento::ControlClient::ListCachesResponse
21
- rpc :CreateSigningKey, ::Momento::ControlClient::CreateSigningKeyRequest, ::Momento::ControlClient::CreateSigningKeyResponse
22
- rpc :RevokeSigningKey, ::Momento::ControlClient::RevokeSigningKeyRequest, ::Momento::ControlClient::RevokeSigningKeyResponse
23
- rpc :ListSigningKeys, ::Momento::ControlClient::ListSigningKeysRequest, ::Momento::ControlClient::ListSigningKeysResponse
24
- end
25
-
26
- Stub = Service.rpc_stub_class
27
- end
28
- end
29
- end
@@ -1,33 +0,0 @@
1
- require 'grpc'
2
- require 'momento/cacheclient_pb'
3
-
4
- module Momento
5
- # Responses specific to delete.
6
- class DeleteResponse < Response
7
- def self.from_block
8
- response = yield
9
- rescue GRPC::BadStatus => e
10
- Error.new(grpc_exception: e)
11
- else
12
- raise TypeError unless response.is_a?(Momento::CacheClient::DeleteResponse)
13
-
14
- Success.new
15
- end
16
-
17
- def success?
18
- false
19
- end
20
-
21
- # The item was deleted from the cache.
22
- class Success < DeleteResponse
23
- def success?
24
- true
25
- end
26
- end
27
-
28
- # There was an error deleting the item from the cache.
29
- class Error < DeleteResponse
30
- include Momento::Response::Error
31
- end
32
- end
33
- end
@@ -1,80 +0,0 @@
1
- require 'grpc'
2
- require 'momento/cacheclient_pb'
3
-
4
- module Momento
5
- # Responses specific to get.
6
- class GetResponse < Response
7
- class << self
8
- # Build a Momento::GetResponse from a block of code
9
- # which returns a Momento::ControlClient::GetResponse.
10
- #
11
- # @return [Momento::GetResponse]
12
- # @raise [StandardError] when the exception is not recognized.
13
- # @raise [TypeError] when the response is not recognized.
14
- def from_block
15
- response = yield
16
- rescue GRPC::BadStatus => e
17
- Error.new(grpc_exception: e)
18
- else
19
- from_response(response)
20
- end
21
-
22
- private
23
-
24
- def from_response(response)
25
- raise TypeError unless response.is_a?(Momento::CacheClient::GetResponse)
26
-
27
- case response.result
28
- when :Hit
29
- Hit.new(grpc_response: response)
30
- when :Miss
31
- Miss.new
32
- else
33
- raise "Unknown get result: #{response.result}"
34
- end
35
- end
36
- end
37
-
38
- def hit?
39
- false
40
- end
41
-
42
- def miss?
43
- false
44
- end
45
-
46
- # Successfully got an item from the cache.
47
- class Hit < GetResponse
48
- # rubocop:disable Lint/MissingSuper
49
- def initialize(grpc_response:)
50
- @grpc_response = grpc_response
51
- end
52
- # rubocop:enable Lint/MissingSuper
53
-
54
- def hit?
55
- true
56
- end
57
-
58
- # @return [String] the value from the cache
59
- def value
60
- @grpc_response.cache_body
61
- end
62
-
63
- def to_s
64
- value
65
- end
66
- end
67
-
68
- # The key had no value stored in the cache.
69
- class Miss < GetResponse
70
- def miss?
71
- true
72
- end
73
- end
74
-
75
- # There was a problem getting the value from the cache.
76
- class Error < GetResponse
77
- include Momento::Response::Error
78
- end
79
- end
80
- end
@@ -1,53 +0,0 @@
1
- require 'grpc'
2
- require 'momento/controlclient_pb'
3
-
4
- module Momento
5
- # Responses specific to list_caches.
6
- class ListCachesResponse < Response
7
- # Build a Momento::ListCachesResponse from a block of code
8
- # which returns a Momento::ControlClient::ListCachesResponse.
9
- #
10
- # @return [Momento::ListCachesResponse]
11
- # @raise [StandardError] when the exception is not recognized.
12
- # @raise [TypeError] when the response is not recognized.
13
- def self.from_block
14
- response = yield
15
- rescue GRPC::BadStatus => e
16
- Error.new(grpc_exception: e)
17
- else
18
- raise TypeError unless response.is_a?(Momento::ControlClient::ListCachesResponse)
19
-
20
- return Success.new(grpc_response: response)
21
- end
22
-
23
- def success?
24
- false
25
- end
26
-
27
- # A Momento resposne with a page of caches.
28
- class Success < ListCachesResponse
29
- # rubocop:disable Lint/MissingSuper
30
- def initialize(grpc_response:)
31
- @grpc_response = grpc_response
32
- end
33
- # rubocop:enable Lint/MissingSuper
34
-
35
- def success?
36
- true
37
- end
38
-
39
- def cache_names
40
- @grpc_response.cache.map(&:cache_name)
41
- end
42
-
43
- def next_token
44
- @grpc_response.next_token
45
- end
46
- end
47
-
48
- # There was an error listing the caches.
49
- class Error < ListCachesResponse
50
- include ::Momento::Response::Error
51
- end
52
- end
53
- end
@@ -1,17 +0,0 @@
1
- require 'grpc'
2
- require_relative 'response/error'
3
- require_relative 'create_cache_response'
4
- require_relative 'delete_response'
5
- require_relative 'delete_cache_response'
6
- require_relative 'get_response'
7
- require_relative 'list_caches_response'
8
- require_relative 'set_response'
9
-
10
- module Momento
11
- # A superclass for all Momento responses.
12
- class Response
13
- def error?
14
- false
15
- end
16
- end
17
- end