aboutsummaryrefslogtreecommitdiff
path: root/object/store/chain/new.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 14:30:31 +0000
committerGravatar Runxi Yu2026-03-25 14:30:31 +0000
commitbfa0a3f5f18b752a6ebd3d5b37411c6871f7bb17 (patch)
tree8ee2479273e2b34d284c30703c2be48efe197556 /object/store/chain/new.go
parent*: Resort import order (diff)
signatureNo signature
*: objectstore -> object/store
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..2cc79b0d
--- /dev/null
+++ b/object/store/chain/new.go
@@ -0,0 +1,13 @@
+package chain
+
+import "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.Store) *Chain {
+ return &Chain{
+ backends: append([]objectstore.Store(nil), backends...),
+ }
+}