diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-07 11:20:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 11:20:24 +0200 |
commit | f32a9b354dd96c263c87e7d470206ee43c2efd67 (patch) | |
tree | e3526dd4f3a4cb0e66cbd5a307d6fe02a76fad8e /src/libstore/download.hh | |
parent | ebb20a5356af023498506324bd0f88a99175e295 (diff) | |
parent | cd39709003eee4b85a31799b8bc2de59721930ce (diff) |
Merge pull request #3459 from NixOS/fetchers
Backport libfetchers from the flakes branch
Diffstat (limited to 'src/libstore/download.hh')
-rw-r--r-- | src/libstore/download.hh | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh index 5a131c704..28c8a9162 100644 --- a/src/libstore/download.hh +++ b/src/libstore/download.hh @@ -65,28 +65,6 @@ struct DownloadResult uint64_t bodySize = 0; }; -struct CachedDownloadRequest -{ - std::string uri; - bool unpack = false; - std::string name; - Hash expectedHash; - unsigned int ttl; - - CachedDownloadRequest(const std::string & uri); - CachedDownloadRequest() = delete; -}; - -struct CachedDownloadResult -{ - // Note: 'storePath' may be different from 'path' when using a - // chroot store. - Path storePath; - Path path; - std::optional<std::string> etag; - std::string effectiveUri; -}; - class Store; struct Downloader @@ -108,12 +86,6 @@ struct Downloader invoked on the thread of the caller. */ void download(DownloadRequest && request, Sink & sink); - /* Check if the specified file is already in ~/.cache/nix/tarballs - and is more recent than ‘tarball-ttl’ seconds. Otherwise, - use the recorded ETag to verify if the server has a more - recent version, and if so, download it to the Nix store. */ - CachedDownloadResult downloadCached(ref<Store> store, const CachedDownloadRequest & request); - enum Error { NotFound, Forbidden, Misc, Transient, Interrupted }; }; @@ -135,4 +107,7 @@ public: bool isUri(const string & s); +/* Resolve deprecated 'channel:<foo>' URLs. */ +std::string resolveUri(const std::string & uri); + } |