20 #ifndef BUILDCACHE_REMOTE_CACHE_PROVIDER_HPP_
21 #define BUILDCACHE_REMOTE_CACHE_PROVIDER_HPP_
23 #include <cache/cache_entry.hpp>
24 #include <cache/expected_file.hpp>
39 virtual bool connect(
const std::string& host_description) = 0;
55 virtual void add(
const std::string& hash,
57 const std::map<std::string, expected_file_t>& expected_files) = 0;
64 virtual void get_file(
const std::string& hash,
65 const std::string& source_id,
66 const std::string& target_path,
67 const bool is_compressed) = 0;
100 #endif // BUILDCACHE_REMOTE_CACHE_PROVIDER_HPP_
virtual void get_file(const std::string &hash, const std::string &source_id, const std::string &target_path, const bool is_compressed)=0
Copy a cached file to the local file system.
virtual bool is_connected() const =0
Check if we have a connection to the remote cache.
virtual ~remote_cache_provider_t()
De-initialzie the remote cache object.
Definition: remote_cache_provider.cpp:30
Definition: remote_cache_provider.hpp:31
The top level namespace.
Definition: compressor.cpp:34
virtual cache_entry_t lookup(const std::string &hash)=0
Check if an entry exists in the cache.
virtual void add(const std::string &hash, const cache_entry_t &entry, const std::map< std::string, expected_file_t > &expected_files)=0
Adds a set of files to the cache.
static int connection_timeout_ms()
Get the timeout for remote connections.
Definition: remote_cache_provider.cpp:85
static bool parse_host_description(const std::string &host_description, std::string &host, int &port, std::string &path)
Parse a host description string.
Definition: remote_cache_provider.cpp:33
Meta data for a single cache entry.
Definition: cache_entry.hpp:28
virtual bool connect(const std::string &host_description)=0
Connect to the remote cache.
static int transfer_timeout_ms()
Get the timeout for remote transfers.
Definition: remote_cache_provider.cpp:91