47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#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>;
|