aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
diff options
context:
space:
mode:
authorKevin Quick <kquick@galois.com>2020-09-26 14:32:58 -0700
committerKevin Quick <kquick@galois.com>2020-09-26 14:32:58 -0700
commitbd5328814fe8055b3f832a087afcf3ef11b06372 (patch)
tree65fc35a513746e981cdb4179bbe0b76aa3942b9a /src/libfetchers
parent8b4a542d1767e0df7b3c0902b766f34352cb0958 (diff)
Add some internal documentation for flake support objects.
Diffstat (limited to 'src/libfetchers')
-rw-r--r--src/libfetchers/fetchers.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh
index 89b1e6e7d..f361edf17 100644
--- a/src/libfetchers/fetchers.hh
+++ b/src/libfetchers/fetchers.hh
@@ -21,6 +21,13 @@ struct Tree
struct InputScheme;
+// The Input object is generated by a specific fetcher, based on the
+// user-supplied input attribute in the flake.nix file, and contians
+// the information that the specific fetcher needs to perform the
+// actual fetch. The Input object is most commonly created via the
+// "fromURL()" or "fromAttrs()" static functions which are provided the
+// url or attrset specified in the flake file.
+
struct Input
{
friend struct InputScheme;
@@ -82,6 +89,15 @@ public:
std::optional<time_t> getLastModified() const;
};
+
+// The InputScheme represents a type of fetcher. Each fetcher
+// registers with nix at startup time. When processing an input for a
+// flake, each scheme is given an opportunity to "recognize" that
+// input from the url or attributes in the flake file's specification
+// and return an Input object to represent the input if it is
+// recognized. The Input object contains the information the fetcher
+// needs to actually perform the "fetch()" when called.
+
struct InputScheme
{
virtual std::optional<Input> inputFromURL(const ParsedURL & url) = 0;