userver: fs::FsCacheClient Class Reference
Loading...
Searching...
No Matches
fs::FsCacheClient Class Referencefinal

#include <userver/fs/fs_cache_client.hpp>

Detailed Description

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

Definition at line 19 of file 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.
 

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: