This commit is contained in:
46
rediska/common/MessageArguments.hpp
Normal file
46
rediska/common/MessageArguments.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <variant>
|
||||
#include "rediska/common/types.hpp"
|
||||
|
||||
struct PrimitiveSetArgs {
|
||||
CacheValue value;
|
||||
TTL ttl_seconds;
|
||||
};
|
||||
|
||||
struct ListCreateArgs {
|
||||
CacheValueId element_kind;
|
||||
TTL ttl_seconds;
|
||||
};
|
||||
|
||||
struct ListIndexArgs {
|
||||
int64_t index;
|
||||
};
|
||||
|
||||
struct ListSetArgs {
|
||||
int64_t index;
|
||||
CacheValue value;
|
||||
};
|
||||
|
||||
struct ListInsertArgs {
|
||||
int64_t index;
|
||||
CacheValue value;
|
||||
};
|
||||
|
||||
struct ListPushBackArgs {
|
||||
CacheValue value;
|
||||
};
|
||||
|
||||
struct ListPushManyArgs {
|
||||
std::vector<CacheValue> values;
|
||||
bool replace_entire_list = false; // true => overwrite entire list, false => append
|
||||
};
|
||||
|
||||
using MessageArguments = std::variant<std::monostate,
|
||||
PrimitiveSetArgs,
|
||||
ListCreateArgs,
|
||||
ListIndexArgs,
|
||||
ListSetArgs,
|
||||
ListInsertArgs,
|
||||
ListPushBackArgs,
|
||||
ListPushManyArgs>;
|
||||
Reference in New Issue
Block a user