aboutsummaryrefslogtreecommitdiff
path: root/object/store/chain/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/store/chain/new.go')
-rw-r--r--object/store/chain/new.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/object/store/chain/new.go b/object/store/chain/new.go
new file mode 100644
index 00000000..c78c7c98
--- /dev/null
+++ b/object/store/chain/new.go
@@ -0,0 +1,13 @@
+package chain
+
+import objectstore "codeberg.org/lindenii/furgit/object/store"
+
+// New creates an ordered object database chain.
+//
+// The provided backends must be non-nil and distinct.
+// Chain borrows the provided backends and does not close them in Close.
+func New(backends ...objectstore.ReadingStore) *Chain {
+ return &Chain{
+ backends: append([]objectstore.ReadingStore(nil), backends...),
+ }
+}