Class client for storing files in memory Usually retrieved from components::FsCache
More...
#include <userver/fs/fs_cache_client.hpp>
|
| 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.
|
|
Class client for storing files in memory Usually retrieved from components::FsCache
Definition at line 19 of file fs_cache_client.hpp.
◆ FsCacheClient()
fs::FsCacheClient::FsCacheClient |
( |
std::string_view |
dir, |
|
|
std::chrono::milliseconds |
update_period, |
|
|
engine::TaskProcessor & |
tp |
|
) |
| |
Fills the cache and starts periodic update.
- Parameters
-
dir | directory to cache files from |
update_period | time (0 - fill the cache only at startup), not used in Linux |
tp | task processor to do filesystem operations |
◆ TryGetFile()
FileInfoWithDataConstPtr fs::FsCacheClient::TryGetFile |
( |
std::string_view |
path | ) |
const |
get file from memory
- Parameters
-
- 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: