aboutsummaryrefslogtreecommitdiff
path: root/ref/store/chain/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'ref/store/chain/new.go')
-rw-r--r--ref/store/chain/new.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/ref/store/chain/new.go b/ref/store/chain/new.go
new file mode 100644
index 00000000..dc8c0779
--- /dev/null
+++ b/ref/store/chain/new.go
@@ -0,0 +1,13 @@
+package chain
+
+import "codeberg.org/lindenii/furgit/ref/store"
+
+// New creates an ordered reference store 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 ...refstore.ReadingStore) *Chain {
+ return &Chain{
+ backends: append([]refstore.ReadingStore(nil), backends...),
+ }
+}