aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29 16:26:16 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29 16:26:16 +0200
commit95d20dfde94fc715f39e2ffeadefc5b5bd5e570b (patch)
treea13f06fd7b0d28f2610eb87dcb4a52203742e51d /src/libstore/local-binary-cache-store.cc
parentaa3bc3d5dcff5ff6567a4e00320cb9caa28c5a93 (diff)
Allow parameters in store URIs
This is to allow store-specific configuration, e.g. s3://my-cache?compression=bzip2&secret-key=/path/to/key.
Diffstat (limited to 'src/libstore/local-binary-cache-store.cc')
-rw-r--r--src/libstore/local-binary-cache-store.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc
index 7968c98b9..2ec9a0d10 100644
--- a/src/libstore/local-binary-cache-store.cc
+++ b/src/libstore/local-binary-cache-store.cc
@@ -16,6 +16,11 @@ public:
void init() override;
+ std::string getUri() override
+ {
+ return "file://" + binaryCacheDir;
+ }
+
protected:
bool fileExists(const std::string & path) override;
@@ -78,7 +83,10 @@ ref<Store> openLocalBinaryCacheStore(std::shared_ptr<Store> localStore,
return store;
}
-static RegisterStoreImplementation regStore([](const std::string & uri) -> std::shared_ptr<Store> {
+static RegisterStoreImplementation regStore([](
+ const std::string & uri, const StoreParams & params)
+ -> std::shared_ptr<Store>
+{
if (std::string(uri, 0, 7) != "file://") return 0;
return openLocalBinaryCacheStore(std::shared_ptr<Store>(0),
settings.get("binary-cache-secret-key-file", string("")),