mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 10:46:15 +02:00
ba5929c7be
After the removal of the InputAccessor::fetchToStore() method, the only remaining functionality in InputAccessor was `fingerprint` and `getLastModified()`, and there is no reason to keep those in a separate class.
46 lines
863 B
C++
46 lines
863 B
C++
#pragma once
|
|
|
|
#include "types.hh"
|
|
#include "path.hh"
|
|
#include "hash.hh"
|
|
|
|
#include <optional>
|
|
|
|
namespace nix {
|
|
class Store;
|
|
struct SourceAccessor;
|
|
}
|
|
|
|
namespace nix::fetchers {
|
|
|
|
struct DownloadFileResult
|
|
{
|
|
StorePath storePath;
|
|
std::string etag;
|
|
std::string effectiveUrl;
|
|
std::optional<std::string> immutableUrl;
|
|
};
|
|
|
|
DownloadFileResult downloadFile(
|
|
ref<Store> store,
|
|
const std::string & url,
|
|
const std::string & name,
|
|
const Headers & headers = {});
|
|
|
|
struct DownloadTarballResult
|
|
{
|
|
Hash treeHash;
|
|
time_t lastModified;
|
|
std::optional<std::string> immutableUrl;
|
|
ref<SourceAccessor> accessor;
|
|
};
|
|
|
|
/**
|
|
* Download and import a tarball into the Git cache. The result is the
|
|
* Git tree hash of the root directory.
|
|
*/
|
|
DownloadTarballResult downloadTarball(
|
|
const std::string & url,
|
|
const Headers & headers = {});
|
|
|
|
}
|