Files
Rediska/rediska/common/types.hpp
Nikita Astafyev 35a6349071
Some checks failed
Code Analysis / analysis (push) Failing after 2m59s
chore: initial commit
2025-12-30 22:34:58 +07:00

31 lines
710 B
C++

#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <variant>
#include <chrono>
#include "rediska/data-structures/impl/ListDataStructure.hpp"
using CacheKey = std::string;
// Definition order of `CacheValue` and `TypeId` MUST match!
using CacheValue = std::variant<bool, int64_t, double, std::string, std::shared_ptr<ListDataStructure>>;
enum class CacheValueId { BOOLEAN = 0, INT, FLOAT, STRING, ARRAY }; // TODO: Object
enum class RediskaReturnCode {
OK,
INCOMPATIBLE_OPERATION,
NOT_FOUND,
KEY_EXPIRED,
UNKNOWN_ERROR,
DS_EMPTY,
DS_OUT_OF_RANGE,
DS_UNKNOWN_ERROR
};
using TTL = uint32_t;
using Timestamp = std::chrono::steady_clock::time_point;