1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Make store implementations pluggable

This for instance allows hydra-queue-runner to add the S3 backend
at runtime.
This commit is contained in:
Eelco Dolstra 2016-02-29 16:11:11 +01:00
parent 6055d84beb
commit 68a5414982
3 changed files with 50 additions and 19 deletions

View file

@ -453,6 +453,23 @@ ref<Store> openStoreAt(const std::string & uri);
ref<Store> openStore();
/* Store implementation registration. */
typedef std::function<std::shared_ptr<Store>(const std::string & uri)> OpenStore;
struct RegisterStoreImplementation
{
typedef std::vector<OpenStore> Implementations;
static Implementations * implementations;
RegisterStoreImplementation(OpenStore fun)
{
if (!implementations) implementations = new Implementations;
implementations->push_back(fun);
}
};
/* Display a set of paths in human-readable form (i.e., between quotes
and separated by commas). */
string showPaths(const PathSet & paths);