userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
ttl_reply.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <chrono>
7
#include <cstdint>
8
#include <string>
9
10
#include <
userver/storages/redis/exception.hpp
>
11
#include <
userver/storages/redis/fwd.hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
storages::redis
{
16
25
class
TtlReply final {
26
public
:
27
enum class
TtlReplyValue { kKeyDoesNotExist = -2, kKeyHasNoExpiration = -1 };
28
29
static
constexpr
TtlReplyValue kKeyDoesNotExist = TtlReplyValue::kKeyDoesNotExist;
30
static
constexpr
TtlReplyValue kKeyHasNoExpiration = TtlReplyValue::kKeyHasNoExpiration;
31
32
explicit
TtlReply(int64_t value);
33
TtlReply(TtlReplyValue value);
34
35
static
TtlReply Parse(
ReplyData
&& reply_data,
const
std::string& request_description = {});
36
37
bool
KeyExists()
const
;
38
bool
KeyHasExpiration()
const
;
39
[[deprecated(
"Use GetExpire() instead"
)]]
size_t
GetExpireSeconds()
const
{
return
GetExpire
().count(); }
40
43
std::chrono::seconds
GetExpire
()
const
;
44
45
private
:
46
int64_t value_;
47
};
48
50
class
KeyHasNoExpirationException
:
public
Exception
{
51
public
:
52
using
Exception::Exception;
53
};
54
55
}
// namespace storages::redis
56
57
USERVER_NAMESPACE_END
userver
storages
redis
ttl_reply.hpp
Generated on
for userver by
Doxygen
1.17.0