aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/fetchers/parse.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-21 16:27:53 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-21 22:56:04 +0100
commit9f4d8c6170517c9452e25dc29c56a6fbb43d40a1 (patch)
tree25295dae9cd204f603b41ae59bc32cd9cb0ce88e /src/libstore/fetchers/parse.hh
parent1bf9eb21b75f0d93d9c1633ea2e6fdf840047e79 (diff)
Pluggable fetchers
Flakes are now fetched using an extensible mechanism. Also lots of other flake cleanups.
Diffstat (limited to 'src/libstore/fetchers/parse.hh')
-rw-r--r--src/libstore/fetchers/parse.hh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libstore/fetchers/parse.hh b/src/libstore/fetchers/parse.hh
new file mode 100644
index 000000000..22cc57816
--- /dev/null
+++ b/src/libstore/fetchers/parse.hh
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "types.hh"
+
+namespace nix::fetchers {
+
+struct ParsedURL
+{
+ std::string url;
+ std::string base; // URL without query/fragment
+ std::string scheme;
+ std::optional<std::string> authority;
+ std::string path;
+ std::map<std::string, std::string> query;
+ std::string fragment;
+
+ std::string to_string() const;
+};
+
+MakeError(BadURL, Error);
+
+std::string percentDecode(std::string_view in);
+
+std::map<std::string, std::string> decodeQuery(const std::string & query);
+
+ParsedURL parseURL(const std::string & url);
+
+}