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:
parent
6055d84beb
commit
68a5414982
3 changed files with 50 additions and 19 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue