summaryrefslogtreecommitdiff
path: root/src/storage.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.h')
-rw-r--r--src/storage.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/storage.h b/src/storage.h
new file mode 100644
index 0000000..2a0ad7e
--- /dev/null
+++ b/src/storage.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "erebos/storage.h"
+
+#include <future>
+
+namespace fs = std::filesystem;
+
+using std::optional;
+using std::shared_future;
+using std::vector;
+
+namespace erebos {
+
+struct Storage::Priv
+{
+ static constexpr size_t CHUNK = 16384;
+
+ fs::path root;
+
+ fs::path objectPath(const Digest &) const;
+ optional<vector<uint8_t>> loadBytes(const Digest &) const;
+ void storeBytes(const Digest &, const vector<uint8_t> &) const;
+};
+
+struct Ref::Priv
+{
+ Storage storage;
+ Digest digest;
+
+ shared_future<Object> object;
+};
+
+}