about summary refs log blame commit diff
path: root/src/libstore/download.hh
blob: aff109ee7ce1f520993c411e9dd5e7d77726c316 (plain) (tree)
1
2
3
4
5
6
7






                   





                         





                      
                                                                         
 

                                                         

                               

                             
 
#pragma once

#include "types.hh"
#include <string>

namespace nix {

struct DownloadOptions
{
    string expectedETag;
    bool verifyTLS{true};
};

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);

}