userver: fs::FsCacheClient Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
fs::FsCacheClient Class Referencefinal

Class client for storing files in memory Usually retrieved from components::FsCache More...

#include <userver/fs/fs_cache_client.hpp>

Public Member Functions

 FsCacheClient (std::string_view dir, std::chrono::milliseconds update_period, engine::TaskProcessor &tp)
 Fills the cache and starts periodic update.
 
FileInfoWithDataConstPtr TryGetFile (std::string_view path) const
 get file from memory
 
void UpdateCache ()
 Concurrency-safe cache update.
 

Detailed Description

Class client for storing files in memory Usually retrieved from components::FsCache

Definition at line 19 of file fs_cache_client.hpp.

Constructor & Destructor Documentation

◆ FsCacheClient()

fs::FsCacheClient::FsCacheClient ( std::string_view  dir,
std::chrono::milliseconds  update_period,
engine::TaskProcessor &  tp 
)

Fills the cache and starts periodic update.

Parameters
dirdirectory to cache files from
update_periodtime (0 - fill the cache only at startup), not used in Linux
tptask processor to do filesystem operations

Member Function Documentation

◆ TryGetFile()

FileInfoWithDataConstPtr fs::FsCacheClient::TryGetFile ( std::string_view  path) const

get file from memory

Parameters
pathto file
Returns
file info and content ; nullptr if no file with specified name on FS

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