20 #ifndef BUILDCACHE_HTTP_CACHE_PROVIDER_HPP_
21 #define BUILDCACHE_HTTP_CACHE_PROVIDER_HPP_
23 #include <cache/remote_cache_provider.hpp>
33 bool connect(
const std::string& host_description)
override;
36 void add(
const std::string& hash,
38 const std::map<std::string, expected_file_t>& expected_files)
override;
39 void get_file(
const std::string& hash,
40 const std::string& source_id,
41 const std::string& target_path,
42 const bool is_compressed)
override;
54 virtual std::vector<std::string>
get_header(
const std::string& method,
55 const std::string& key)
const;
70 std::string
get_data(
const std::string& key);
77 void set_data(
const std::string& key,
const std::string& data);
83 bool m_ready_for_action =
false;
88 #endif // BUILDCACHE_S3_CACHE_PROVIDER_HPP_
bool connect(const std::string &host_description) override
Connect to the remote cache.
Definition: http_cache_provider.cpp:60
virtual std::vector< std::string > get_header(const std::string &method, const std::string &key) const
Get the headers for the HTTP request.
Definition: http_cache_provider.cpp:148
Definition: http_cache_provider.hpp:27
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: http_cache_provider.cpp:132
std::string get_data(const std::string &key)
Get a binary data blob from the remote cache.
Definition: http_cache_provider.cpp:154
bool is_connected() const override
Check if we have a connection to the remote cache.
Definition: http_cache_provider.cpp:80
cache_entry_t lookup(const std::string &hash) override
Check if an entry exists in the cache.
Definition: http_cache_provider.cpp:94
Definition: remote_cache_provider.hpp:31
The top level namespace.
Definition: compressor.cpp:34
void disconnect()
Disconnect (usually as a result of an error).
Definition: http_cache_provider.cpp:84
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: http_cache_provider.cpp:106
std::string get_path() const
Get the path of the destination URL.
Definition: http_cache_provider.cpp:144
std::string get_object_url(const std::string &key)
Get the full URL for a given object.
Definition: http_cache_provider.cpp:88
void set_data(const std::string &key, const std::string &data)
Set a binary data blob in the remote cache.
Definition: http_cache_provider.cpp:188
Meta data for a single cache entry.
Definition: cache_entry.hpp:28