mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
29 lines
449 B
C++
29 lines
449 B
C++
#pragma once
|
|
|
|
#include "types.hh"
|
|
#include <string>
|
|
|
|
namespace nix {
|
|
|
|
struct DownloadOptions
|
|
{
|
|
string expectedETag;
|
|
bool verifyTLS{true};
|
|
bool forceProgress{false};
|
|
};
|
|
|
|
struct DownloadResult
|
|
{
|
|
bool cached;
|
|
string data, etag;
|
|
};
|
|
|
|
DownloadResult downloadFile(string url, const DownloadOptions & options);
|
|
|
|
Path downloadFileCached(const string & url, bool unpack);
|
|
|
|
MakeError(DownloadError, Error)
|
|
|
|
bool isUri(const string & s);
|
|
|
|
}
|