userver: userver/storages/redis/mock_transaction_impl_base.hpp Source File
Loading...
Searching...
No Matches
mock_transaction_impl_base.hpp
1#pragma once
2
4
6
7USERVER_NAMESPACE_BEGIN
8
9namespace storages::redis {
10
13public:
15 enum class ExecResult {
18 };
19
20 virtual ~MockTransactionImplBase() = default;
21
22 // redis commands:
23
30 virtual ExecResult Exec(ExecOptions options);
31
32 virtual RequestAppend Append(std::string key, std::string value);
33
34 virtual RequestBitop Bitop(BitOperation op, std::string dest_key, std::vector<std::string> src_keys);
35 virtual RequestDbsize Dbsize(size_t shard);
36
37 virtual RequestDecr Decr(std::string key);
38
39 virtual RequestDel Del(std::string key);
40
41 virtual RequestDel Del(std::vector<std::string> keys);
42
43 virtual RequestUnlink Unlink(std::string key);
44
45 virtual RequestUnlink Unlink(std::vector<std::string> keys);
46
47 virtual RequestExists Exists(std::string key);
48
49 virtual RequestExists Exists(std::vector<std::string> keys);
50
51 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl);
52
53 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl, ExpireOptions options);
54
55 virtual RequestGeoadd Geoadd(std::string key, GeoaddArg point_member);
56
57 virtual RequestGeoadd Geoadd(std::string key, std::vector<GeoaddArg> point_members);
58
59 virtual RequestGeopos Geopos(std::string key, std::vector<std::string> members);
60
61 virtual RequestGeoradius Georadius(
62 std::string key,
63 Longitude lon,
64 Latitude lat,
65 double radius,
66 const GeoradiusOptions& georadius_options
67 );
68
69 virtual RequestGeosearch Geosearch(
70 std::string key,
71 std::string member,
72 double radius,
73 const GeosearchOptions& geosearch_options
74 );
75
76 virtual RequestGeosearch Geosearch(
77 std::string key,
78 std::string member,
79 BoxWidth width,
80 BoxHeight height,
81 const GeosearchOptions& geosearch_options
82 );
83
84 virtual RequestGeosearch Geosearch(
85 std::string key,
86 Longitude lon,
87 Latitude lat,
88 double radius,
89 const GeosearchOptions& geosearch_options
90 );
91
92 virtual RequestGeosearch Geosearch(
93 std::string key,
94 Longitude lon,
95 Latitude lat,
96 BoxWidth width,
97 BoxHeight height,
98 const GeosearchOptions& geosearch_options
99 );
100
101 virtual RequestGet Get(std::string key);
102
103 virtual RequestGetdel Getdel(std::string key);
104
105 virtual RequestGetset Getset(std::string key, std::string value);
106
107 virtual RequestHdel Hdel(std::string key, std::string field);
108
109 virtual RequestHdel Hdel(std::string key, std::vector<std::string> fields);
110
111 virtual RequestHexists Hexists(std::string key, std::string field);
112
113 virtual RequestHget Hget(std::string key, std::string field);
114
115 virtual RequestHgetall Hgetall(std::string key);
116
117 virtual RequestHincrby Hincrby(std::string key, std::string field, int64_t increment);
118
119 virtual RequestHincrbyfloat Hincrbyfloat(std::string key, std::string field, double increment);
120
121 virtual RequestHkeys Hkeys(std::string key);
122
123 virtual RequestHlen Hlen(std::string key);
124
125 virtual RequestHmget Hmget(std::string key, std::vector<std::string> fields);
126
127 virtual RequestHmset Hmset(std::string key, std::vector<std::pair<std::string, std::string>> field_values);
128
129 virtual RequestHset Hset(std::string key, std::string field, std::string value);
130
131 virtual RequestHsetnx Hsetnx(std::string key, std::string field, std::string value);
132
133 virtual RequestHvals Hvals(std::string key);
134
135 virtual RequestIncr Incr(std::string key);
136
137 virtual RequestKeys Keys(std::string keys_pattern, size_t shard);
138
139 virtual RequestLindex Lindex(std::string key, int64_t index);
140
141 virtual RequestLlen Llen(std::string key);
142
143 virtual RequestLpop Lpop(std::string key);
144
145 virtual RequestLpush Lpush(std::string key, std::string value);
146
147 virtual RequestLpush Lpush(std::string key, std::vector<std::string> values);
148
149 virtual RequestLpushx Lpushx(std::string key, std::string element);
150
151 virtual RequestLrange Lrange(std::string key, int64_t start, int64_t stop);
152
153 virtual RequestLrem Lrem(std::string key, int64_t count, std::string element);
154
155 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop);
156
157 virtual RequestMget Mget(std::vector<std::string> keys);
158
159 virtual RequestMset Mset(std::vector<std::pair<std::string, std::string>> key_values);
160
161 virtual RequestMsetex Msetex(std::vector<std::pair<std::string, std::string>> key_values);
162
163 virtual RequestMsetex Msetex(std::vector<std::pair<std::string, std::string>> key_values, MsetexOptions options);
164
165 virtual RequestPersist Persist(std::string key);
166
167 virtual RequestPexpire Pexpire(std::string key, std::chrono::milliseconds ttl);
168
169 virtual RequestPing Ping(size_t shard);
170
171 virtual RequestPingMessage PingMessage(size_t shard, std::string message);
172
173 virtual RequestRename Rename(std::string key, std::string new_key);
174
175 virtual RequestRpop Rpop(std::string key);
176
177 virtual RequestRpush Rpush(std::string key, std::string value);
178
179 virtual RequestRpush Rpush(std::string key, std::vector<std::string> values);
180
181 virtual RequestRpushx Rpushx(std::string key, std::string element);
182
183 virtual RequestSadd Sadd(std::string key, std::string member);
184
185 virtual RequestSadd Sadd(std::string key, std::vector<std::string> members);
186
187 virtual RequestScard Scard(std::string key);
188
189 virtual RequestSet Set(std::string key, std::string value);
190
191 virtual RequestSet Set(std::string key, std::string value, std::chrono::milliseconds ttl);
192
193 virtual RequestSetIfExist SetIfExist(std::string key, std::string value);
194
195 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, std::chrono::milliseconds ttl);
196
197 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value);
198
199 virtual RequestSetIfNotExist SetIfNotExist(std::string key, std::string value, std::chrono::milliseconds ttl);
200
201 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(std::string key, std::string value);
202
203 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(
204 std::string key,
205 std::string value,
206 std::chrono::milliseconds ttl
207 );
208
209 virtual RequestSetex Setex(std::string key, std::chrono::seconds seconds, std::string value);
210
211 virtual RequestSetAndGetPrevious SetAndGetPrevious(
212 std::string key,
213 std::string value,
214 std::chrono::milliseconds ttl
215 );
216
217 virtual RequestSismember Sismember(std::string key, std::string member);
218
219 virtual RequestSmembers Smembers(std::string key);
220
221 virtual RequestSrandmember Srandmember(std::string key);
222
223 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count);
224
225 virtual RequestSrem Srem(std::string key, std::string member);
226
227 virtual RequestSrem Srem(std::string key, std::vector<std::string> members);
228
229 virtual RequestStrlen Strlen(std::string key);
230
231 virtual RequestTime Time(size_t shard);
232
233 virtual RequestTtl Ttl(std::string key);
234
235 virtual RequestType Type(std::string key);
236
237 virtual RequestZadd Zadd(std::string key, double score, std::string member);
238
239 virtual RequestZadd Zadd(std::string key, double score, std::string member, const ZaddOptions& options);
240
241 virtual RequestZadd Zadd(std::string key, std::vector<std::pair<double, std::string>> scored_members);
242
243 virtual RequestZadd Zadd(
244 std::string key,
245 std::vector<std::pair<double, std::string>> scored_members,
246 const ZaddOptions& options
247 );
248
249 virtual RequestZaddIncr ZaddIncr(std::string key, double score, std::string member);
250
251 virtual RequestZaddIncrExisting ZaddIncrExisting(std::string key, double score, std::string member);
252
253 virtual RequestZcard Zcard(std::string key);
254
255 virtual RequestZcount Zcount(std::string key, double min, double max);
256
257 virtual RequestZrange Zrange(std::string key, int64_t start, int64_t stop);
258
259 virtual RequestZrangeWithScores ZrangeWithScores(std::string key, int64_t start, int64_t stop);
260
261 virtual RequestZrangebyscore Zrangebyscore(std::string key, double min, double max);
262
263 virtual RequestZrangebyscore Zrangebyscore(std::string key, std::string min, std::string max);
264
265 virtual RequestZrangebyscore Zrangebyscore(
266 std::string key,
267 double min,
268 double max,
269 const RangeOptions& range_options
270 );
271
272 virtual RequestZrangebyscore Zrangebyscore(
273 std::string key,
274 std::string min,
275 std::string max,
276 const RangeOptions& range_options
277 );
278
279 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key, double min, double max);
280
281 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(std::string key, std::string min, std::string max);
282
283 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
284 std::string key,
285 double min,
286 double max,
287 const RangeOptions& range_options
288 );
289
290 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
291 std::string key,
292 std::string min,
293 std::string max,
294 const RangeOptions& range_options
295 );
296
297 virtual RequestZrem Zrem(std::string key, std::string member);
298
299 virtual RequestZrem Zrem(std::string key, std::vector<std::string> members);
300
301 virtual RequestZremrangebyrank Zremrangebyrank(std::string key, int64_t start, int64_t stop);
302
303 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, double min, double max);
304
305 virtual RequestZremrangebyscore Zremrangebyscore(std::string key, std::string min, std::string max);
306
307 virtual RequestZscore Zscore(std::string key, std::string member);
308
309 virtual RequestHexpire Hexpire(std::string key, std::chrono::seconds ttl, std::vector<std::string> fields);
310
311 virtual RequestHexpire Hexpire(
312 std::string key,
313 std::chrono::seconds ttl,
314 ExpireOptions options,
315 std::vector<std::string> fields
316 );
317
318 virtual RequestHexpire Hpexpire(std::string key, std::chrono::milliseconds ttl, std::vector<std::string> fields);
319
320 virtual RequestHexpire Hpexpire(
321 std::string key,
322 std::chrono::milliseconds ttl,
323 ExpireOptions options,
324 std::vector<std::string> fields
325 );
326
327 virtual RequestHexpire Hexpireat(
328 std::string key,
329 std::chrono::system_clock::time_point deadline,
330 std::vector<std::string> fields
331 );
332
333 virtual RequestHexpire Hexpireat(
334 std::string key,
335 std::chrono::system_clock::time_point deadline,
336 ExpireOptions options,
337 std::vector<std::string> fields
338 );
339
340 virtual RequestHexpire Hpexpireat(
341 std::string key,
342 std::chrono::system_clock::time_point deadline,
343 std::vector<std::string> fields
344 );
345
346 virtual RequestHexpire Hpexpireat(
347 std::string key,
348 std::chrono::system_clock::time_point deadline,
349 ExpireOptions options,
350 std::vector<std::string> fields
351 );
352
353 virtual RequestHexpiretime Hexpiretime(std::string key, std::vector<std::string> fields);
354
355 virtual RequestHpexpiretime Hpexpiretime(std::string key, std::vector<std::string> fields);
356
357 virtual RequestHttl Httl(std::string key, std::vector<std::string> fields);
358
359 virtual RequestHpttl Hpttl(std::string key, std::vector<std::string> fields);
360
361 virtual RequestHpersist Hpersist(std::string key, std::vector<std::string> fields);
362
363 virtual RequestHgetex Hgetex(std::string key, std::vector<std::string> fields);
364
365 virtual RequestHgetex Hgetex(std::string key, HgetexOptions options, std::vector<std::string> fields);
366
367 virtual RequestHsetex Hsetex(std::string key, std::vector<HsetexFieldValue> field_values);
368
369 virtual RequestHsetex Hsetex(std::string key, HsetexOptions options, std::vector<HsetexFieldValue> field_values);
370
371 virtual RequestJsonSet JsonSet(std::string key, std::string path, formats::json::Value value);
372
373 virtual RequestJsonSetIfNotExist JsonSetIfNotExist(std::string key, std::string path, formats::json::Value value);
374
375 virtual RequestJsonSetIfExist JsonSetIfExist(std::string key, std::string path, formats::json::Value value);
376
377 virtual RequestJsonGet JsonGet(std::string key);
378
379 virtual RequestJsonGet JsonGet(std::string key, std::string path);
380
381 virtual RequestJsonGet JsonGet(std::string key, std::vector<std::string> paths);
382
383 virtual RequestJsonMget JsonMget(std::vector<std::string> keys, std::string path);
384
385 virtual RequestJsonMset JsonMset(std::vector<JsonKeyPathValue> key_path_values);
386
387 // end of redis commands
388};
389
390} // namespace storages::redis
391
392USERVER_NAMESPACE_END