#include <fetchers.hh>
Public Member Functions | |
virtual std::optional< Input > | inputFromURL (const Settings &settings, const ParsedURL &url, bool requireTree) const =0 |
virtual std::optional< Input > | inputFromAttrs (const Settings &settings, const Attrs &attrs) const =0 |
virtual std::string_view | schemeName () const =0 |
virtual StringSet | allowedAttrs () const =0 |
virtual ParsedURL | toURL (const Input &input) const |
virtual Input | applyOverrides (const Input &input, std::optional< std::string > ref, std::optional< Hash > rev) const |
virtual void | clone (const Input &input, const Path &destDir) const |
virtual std::optional< std::filesystem::path > | getSourcePath (const Input &input) const |
virtual void | putFile (const Input &input, const CanonPath &path, std::string_view contents, std::optional< std::string > commitMsg) const |
virtual std::pair< ref< SourceAccessor >, Input > | getAccessor (ref< Store > store, const Input &input) const =0 |
virtual std::optional< ExperimentalFeature > | experimentalFeature () const |
virtual bool | isDirect (const Input &input) const |
virtual std::optional< std::string > | getFingerprint (ref< Store > store, const Input &input) const |
virtual bool | isLocked (const Input &input) const |
virtual std::optional< std::string > | isRelative (const Input &input) const |
The InputScheme
represents a type of fetcher. Each fetcher registers with nix at startup time. When processing an Input
, each scheme is given an opportunity to "recognize" that input from the user-provided url or attributes 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.
|
pure virtual |
Allowed attributes in an attribute set that is converted to an input.
type
is not included from this set, because the type
field is parsed first to choose which scheme; type
is always required.
Implemented in nix::fetchers::CurlInputScheme, nix::fetchers::GitArchiveInputScheme, nix::fetchers::GitInputScheme, nix::fetchers::IndirectInputScheme, nix::fetchers::MercurialInputScheme, and nix::fetchers::PathInputScheme.
|
virtual |
Is this InputScheme
part of an experimental feature?
Reimplemented in nix::fetchers::GitArchiveInputScheme, nix::fetchers::IndirectInputScheme, and nix::fetchers::PathInputScheme.
|
pure virtual |
What is the name of the scheme?
The type
attribute is used to select which input scheme is used, and then the other fields are forwarded to that input scheme.
Implemented in nix::fetchers::FileInputScheme, nix::fetchers::GitHubInputScheme, nix::fetchers::GitInputScheme, nix::fetchers::GitLabInputScheme, nix::fetchers::IndirectInputScheme, nix::fetchers::MercurialInputScheme, nix::fetchers::PathInputScheme, nix::fetchers::SourceHutInputScheme, and nix::fetchers::TarballInputScheme.