20 #ifndef BUILDCACHE_REDIS_CACHE_PROVIDER_HPP_
21 #define BUILDCACHE_REDIS_CACHE_PROVIDER_HPP_
23 #include <cache/remote_cache_provider.hpp>
26 typedef struct redisContext redisContext;
36 bool connect(
const std::string& host_description)
override;
39 void add(
const std::string& hash,
41 const std::map<std::string, expected_file_t>& expected_files)
override;
42 void get_file(
const std::string& hash,
43 const std::string& source_id,
44 const std::string& target_path,
45 const bool is_compressed)
override;
56 std::string
get_data(
const std::string& key);
63 void set_data(
const std::string& key,
const std::string& data);
65 redisContext* m_ctx =
nullptr;
70 #endif // BUILDCACHE_REDIS_CACHE_PROVIDER_HPP_
cache_entry_t lookup(const std::string &hash) override
Check if an entry exists in the cache.
Definition: redis_cache_provider.cpp:124
Definition: remote_cache_provider.hpp:31
Definition: redis_cache_provider.hpp:30
The top level namespace.
Definition: compressor.cpp:34
void set_data(const std::string &key, const std::string &data)
Set a binary data blob in the remote cache.
Definition: redis_cache_provider.cpp:215
void add(const std::string &hash, const cache_entry_t &entry, const std::map< std::string, expected_file_t > &expected_files) override
Adds a set of files to the cache.
Definition: redis_cache_provider.cpp:136
void get_file(const std::string &hash, const std::string &source_id, const std::string &target_path, const bool is_compressed) override
Copy a cached file to the local file system.
Definition: redis_cache_provider.cpp:162
void disconnect()
Disconnect (usually as a result of an error).
Definition: redis_cache_provider.cpp:117
bool connect(const std::string &host_description) override
Connect to the remote cache.
Definition: redis_cache_provider.cpp:73
bool is_connected() const override
Check if we have a connection to the remote cache.
Definition: redis_cache_provider.cpp:113
std::string get_data(const std::string &key)
Get a binary data blob from the remote cache.
Definition: redis_cache_provider.cpp:174
Meta data for a single cache entry.
Definition: cache_entry.hpp:28