From 95d20dfde94fc715f39e2ffeadefc5b5bd5e570b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 29 Apr 2016 16:26:16 +0200 Subject: Allow parameters in store URIs This is to allow store-specific configuration, e.g. s3://my-cache?compression=bzip2&secret-key=/path/to/key. --- src/libstore/local-binary-cache-store.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/libstore/local-binary-cache-store.cc') diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc index 7968c98b9558..2ec9a0d1045c 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 openLocalBinaryCacheStore(std::shared_ptr localStore, return store; } -static RegisterStoreImplementation regStore([](const std::string & uri) -> std::shared_ptr { +static RegisterStoreImplementation regStore([]( + const std::string & uri, const StoreParams & params) + -> std::shared_ptr +{ if (std::string(uri, 0, 7) != "file://") return 0; return openLocalBinaryCacheStore(std::shared_ptr(0), settings.get("binary-cache-secret-key-file", string("")), -- cgit 1.4.1