userver: storages::redis::HgetexOptions Struct Reference
Loading...
Searching...
No Matches
storages::redis::HgetexOptions Struct Reference

#include <userver/storages/redis/command_options.hpp>

Detailed Description

Options for HGETEX command — at most one TTL action per call.

Definition at line 264 of file command_options.hpp.

Public Types

enum class  TtlAction : std::uint8_t {
  kKeep ,
  kSetSeconds ,
  kSetMilliseconds ,
  kSetAtSeconds ,
  kSetAtMilliseconds ,
  kPersist
}
 What to do with the TTL of each fetched field. More...
 

Static Public Member Functions

static HgetexOptions Keep ()
 Do not touch the TTL of the read fields (no modifier on the wire).
 
static HgetexOptions Persist ()
 Remove TTL on all read fields (PERSIST modifier).
 
static HgetexOptions Expire (std::chrono::milliseconds ttl)
 Set TTL to a relative duration. Posted on the wire as PX (ms-precision).
 
static HgetexOptions ExpireAt (std::chrono::system_clock::time_point deadline)
 Set TTL to an absolute deadline. Posted on the wire as PXAT (ms-precision).
 

Public Attributes

TtlAction ttl_action {TtlAction::kKeep}
 
std::chrono::milliseconds ttl {0}
 

Member Enumeration Documentation

◆ TtlAction

enum class storages::redis::HgetexOptions::TtlAction : std::uint8_t
strong

What to do with the TTL of each fetched field.

Enumerator
kKeep 

Leave the TTL unchanged (no modifier on the wire).

kSetSeconds 

EX seconds — set TTL to a duration; ttl is interpreted as whole seconds.

kSetMilliseconds 

PX milliseconds — set TTL to a duration; ttl is used as-is in milliseconds.

kSetAtSeconds 

EXAT unix-ts-sec — set absolute expiration; ttl is interpreted as whole seconds since epoch.

kSetAtMilliseconds 

PXAT unix-ts-ms — set absolute expiration; ttl is used as-is in milliseconds since epoch.

kPersist 

PERSIST — remove TTL from the fields; ttl is ignored.

Definition at line 266 of file command_options.hpp.

Member Data Documentation

◆ ttl

std::chrono::milliseconds storages::redis::HgetexOptions::ttl {0}

Definition at line 282 of file command_options.hpp.

◆ ttl_action

TtlAction storages::redis::HgetexOptions::ttl_action {TtlAction::kKeep}

Definition at line 281 of file command_options.hpp.


The documentation for this struct was generated from the following file: