aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/s3-binary-cache-store.cc
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-09-09 11:29:17 +0200
committerregnat <rg@regnat.ovh>2020-09-16 13:53:08 +0200
commit3b57181f8ed94cfa149ad4319ba96d41c5fbc30e (patch)
tree76482159f03ceb75eab14c3f4a682eae22d6fe14 /src/libstore/s3-binary-cache-store.cc
parentfa32560169ffa55b9e0b6d5f04c3792acf0c544a (diff)
Separate the instantiation and initialisation of the stores
Add a new `init()` method to the `Store` class that is supposed to handle all the effectful initialisation needed to set-up the store. The constructor should remain side-effect free and just initialize the c++ data structure. The goal behind that is that we can create “dummy” instances of each store to query static properties about it (the parameters it accepts for example)
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r--src/libstore/s3-binary-cache-store.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index f426b43a9..ab27f203f 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -192,6 +192,9 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
S3Helper s3Helper;
+ S3BinaryCacheStoreImpl(const Params & params)
+ : S3BinaryCacheStoreImpl("dummy-bucket", params) {}
+
S3BinaryCacheStoreImpl(
const std::string & bucketName,
const Params & params)