about summary refs log tree commit diff
path: root/src/libexpr/download.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/download.hh')
-rw-r--r--src/libexpr/download.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libexpr/download.hh b/src/libexpr/download.hh
new file mode 100644
index 000000000000..28c9117e4227
--- /dev/null
+++ b/src/libexpr/download.hh
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "types.hh"
+#include <string>
+
+namespace nix {
+
+struct DownloadResult
+{
+    bool cached;
+    string data, etag;
+};
+
+DownloadResult downloadFile(string url, string expectedETag = "");
+
+Path downloadFileCached(const string & url, bool unpack);
+
+MakeError(DownloadError, Error)
+
+bool isUri(const string & s);
+
+}