forked from momentohq/client-protos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cacheclient.proto
393 lines (313 loc) · 7.93 KB
/
cacheclient.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
syntax = "proto3";
option go_package = "github.com/momentohq/client-sdk-go;client_sdk_go";
option java_multiple_files = true;
option java_package = "grpc.cache_client";
option csharp_namespace = "Momento.Protos.CacheClient";
package cache_client;
enum ECacheResult {
Invalid = 0;
Ok = 1;
Hit = 2;
Miss = 3;
reserved 4 to 6;
}
service Scs {
rpc Get (_GetRequest) returns (_GetResponse) {}
rpc Set (_SetRequest) returns (_SetResponse) {}
rpc SetIfNotExists (_SetIfNotExistsRequest) returns (_SetIfNotExistsResponse) {}
rpc Delete (_DeleteRequest) returns (_DeleteResponse) {}
rpc DictionaryGet (_DictionaryGetRequest) returns (_DictionaryGetResponse) {}
rpc DictionaryFetch (_DictionaryFetchRequest) returns (_DictionaryFetchResponse) {}
rpc DictionarySet (_DictionarySetRequest) returns (_DictionarySetResponse) {}
rpc DictionaryIncrement (_DictionaryIncrementRequest) returns (_DictionaryIncrementResponse) {}
rpc DictionaryDelete (_DictionaryDeleteRequest) returns (_DictionaryDeleteResponse) {}
rpc SetFetch (_SetFetchRequest) returns (_SetFetchResponse) {}
rpc SetUnion (_SetUnionRequest) returns (_SetUnionResponse) {}
rpc SetDifference (_SetDifferenceRequest) returns (_SetDifferenceResponse) {}
rpc ListPushFront(_ListPushFrontRequest) returns (_ListPushFrontResponse) {}
rpc ListPushBack(_ListPushBackRequest) returns (_ListPushBackResponse) {}
rpc ListPopFront(_ListPopFrontRequest) returns (_ListPopFrontResponse) {}
rpc ListPopBack(_ListPopBackRequest) returns (_ListPopBackResponse) {}
rpc ListErase(_ListEraseRequest) returns (_ListEraseResponse) {}
rpc ListRemove(_ListRemoveRequest) returns (_ListRemoveResponse) {}
rpc ListFetch(_ListFetchRequest) returns (_ListFetchResponse) {}
rpc ListLength(_ListLengthRequest) returns (_ListLengthResponse) {}
rpc ListConcatenateFront(_ListConcatenateFrontRequest) returns (_ListConcatenateFrontResponse) {}
rpc ListConcatenateBack(_ListConcatenateBackRequest) returns (_ListConcatenateBackResponse) {}
}
message _GetRequest {
bytes cache_key = 1;
}
message _GetResponse {
ECacheResult result = 1;
bytes cache_body = 2;
string message = 3;
}
message _DeleteRequest {
bytes cache_key = 1;
}
message _DeleteResponse {}
message _SetRequest {
bytes cache_key = 1;
bytes cache_body = 2;
uint64 ttl_milliseconds = 3;
}
message _SetResponse {
ECacheResult result = 1;
string message = 2;
}
message _SetIfNotExistsRequest {
bytes cache_key = 1;
bytes cache_body = 2;
uint64 ttl_milliseconds = 3;
}
message _SetIfNotExistsResponse {
oneof result {
_Stored stored = 1;
_NotStored not_stored = 2;
}
message _Stored { }
message _NotStored { }
}
message _DictionaryGetRequest {
bytes dictionary_name = 1;
repeated bytes fields = 2;
}
message _DictionaryGetResponse {
message _DictionaryGetResponsePart {
ECacheResult result = 1;
bytes cache_body = 2;
}
message _Found {
repeated _DictionaryGetResponsePart items = 1;
}
message _Missing {}
oneof dictionary {
_Found found = 1;
_Missing missing = 2;
}
}
message _DictionaryFetchRequest {
bytes dictionary_name = 1;
}
message _DictionaryFieldValuePair {
bytes field = 1;
bytes value = 2;
}
message _DictionaryFetchResponse {
message _Found {
repeated _DictionaryFieldValuePair items = 1;
}
message _Missing {}
oneof dictionary {
_Found found = 1;
_Missing missing = 2;
}
}
message _DictionarySetRequest {
bytes dictionary_name = 1;
repeated _DictionaryFieldValuePair items = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
}
message _DictionarySetResponse {}
message _DictionaryIncrementRequest {
bytes dictionary_name = 1;
bytes field = 2;
int64 amount = 3;
uint64 ttl_milliseconds = 4;
bool refresh_ttl = 5;
}
message _DictionaryIncrementResponse {
int64 value = 1;
}
message _DictionaryDeleteRequest {
message Some {
repeated bytes fields = 1;
}
message All { }
bytes dictionary_name = 1;
oneof delete {
Some some = 2;
All all = 3;
}
}
message _DictionaryDeleteResponse {}
message _SetFetchRequest {
bytes set_name = 1;
}
message _SetFetchResponse {
message _Found {
repeated bytes elements = 1;
}
message _Missing {}
oneof set {
_Found found = 1;
_Missing missing = 2;
}
}
message _SetUnionRequest {
bytes set_name = 1;
repeated bytes elements = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
}
message _SetUnionResponse {}
message _SetDifferenceRequest {
// cache = request - stored
message _Minuend {
repeated bytes elements = 1;
}
// cache = stored - request
message _Subtrahend {
// Subtract a set of elements
message _Set {
repeated bytes elements = 1;
}
// Subtract the set's identity (itself) from itself - which deletes it.
message _Identity {}
oneof subtrahend_set {
_Set set = 1;
_Identity identity = 2;
}
}
bytes set_name = 1;
oneof difference {
_Minuend minuend = 2;
_Subtrahend subtrahend = 3;
}
}
message _SetDifferenceResponse {
message _Found {}
message _Missing {}
oneof set {
_Found found = 1;
_Missing missing = 2;
}
}
message _ListConcatenateFrontRequest {
bytes list_name = 1;
repeated bytes values = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
// ensure total length <= this; remove excess from back of list
uint32 truncate_back_to_size = 5;
}
message _ListConcatenateFrontResponse {
// length of the list after the concatenation
uint32 list_length = 1;
}
message _ListConcatenateBackRequest {
bytes list_name = 1;
repeated bytes values = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
// ensure total length <= this; remove excess from front of list
uint32 truncate_front_to_size = 5;
}
message _ListConcatenateBackResponse {
// length of the list after the concatenation
uint32 list_length = 1;
}
// stored = request + stored
message _ListPushFrontRequest {
bytes list_name = 1;
bytes value = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
// ensure total length <= this; remove excess from back of list
uint32 truncate_back_to_size = 5;
}
message _ListPushFrontResponse {
// length of the list after the push
uint32 list_length = 1;
}
// stored = stored + request
message _ListPushBackRequest {
bytes list_name = 1;
bytes value = 2;
uint64 ttl_milliseconds = 3;
bool refresh_ttl = 4;
// ensure total length <= this; remove excess from front of list
uint32 truncate_front_to_size = 5;
}
message _ListPushBackResponse {
// length of the list after the push
uint32 list_length = 1;
}
message _ListPopFrontRequest {
bytes list_name = 1;
}
message _ListPopFrontResponse {
message _Found {
bytes front = 1;
}
message _Missing {}
oneof list {
_Found found = 1;
_Missing missing = 2;
}
}
message _ListPopBackRequest {
bytes list_name = 1;
}
message _ListPopBackResponse {
message _Found {
bytes back = 1;
}
message _Missing {}
oneof list {
_Found found = 1;
_Missing missing = 2;
}
}
message _ListRange {
uint32 begin_index = 1;
uint32 count = 2;
}
message _ListEraseRequest {
message _All {}
message _ListRanges {
repeated _ListRange ranges = 1;
}
bytes list_name = 1;
oneof erase {
_ListRanges some = 2;
_All all = 3;
}
}
message _ListEraseResponse {}
message _ListRemoveRequest {
bytes list_name = 1;
oneof remove {
// Remove all appearances in the list where the element is this value
bytes all_elements_with_value = 2;
}
}
message _ListRemoveResponse {}
message _ListFetchRequest {
bytes list_name = 1;
}
message _ListFetchResponse {
message _Found {
repeated bytes values = 1;
}
message _Missing {}
oneof list {
_Found found = 1;
_Missing missing = 2;
}
}
message _ListLengthRequest {
bytes list_name = 1;
}
message _ListLengthResponse {
message _Found {
uint32 length = 1;
}
message _Missing {}
oneof list {
_Found found = 1;
_Missing missing = 2;
}
}