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


                   
 



                 



                         
                              

  





                      

               
                                                                         
 
                                                                              
 

                               

                             
 
#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;
};

class StoreAPI;

DownloadResult downloadFile(string url, const DownloadOptions & options);

Path downloadFileCached(ref<StoreAPI> store, const string & url, bool unpack);

MakeError(DownloadError, Error)

bool isUri(const string & s);

}