aboutsummaryrefslogtreecommitdiff
path: root/ref/store/files/store.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 14:31:16 +0000
committerGravatar Runxi Yu2026-03-25 14:31:16 +0000
commit48ff647cf4a8bb8f23fcd6b8616f56a8ef72b980 (patch)
treeae199c38042adaa544d5f7d31351661d5831381e /ref/store/files/store.go
parent*: objectstore -> object/store (diff)
signatureNo signature
*: refstore -> ref/store
Diffstat (limited to 'ref/store/files/store.go')
-rw-r--r--ref/store/files/store.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/ref/store/files/store.go b/ref/store/files/store.go
new file mode 100644
index 00000000..e0cced65
--- /dev/null
+++ b/ref/store/files/store.go
@@ -0,0 +1,32 @@
+// Package files provides one Git files ref store with loose-over-packed reads
+// and transaction-coordinated updates.
+package files
+
+import (
+ "math/rand"
+ "os"
+ "time"
+
+ objectid "codeberg.org/lindenii/furgit/object/id"
+ "codeberg.org/lindenii/furgit/ref/store"
+)
+
+// Store reads and writes one Git files ref namespace rooted at one repository
+// gitdir plus its commondir.
+//
+// Store borrows gitRoot and owns commonRoot. Close releases only resources
+// opened by the store itself.
+type Store struct {
+ gitRoot *os.Root
+ commonRoot *os.Root
+ algo objectid.Algorithm
+ lockRand *rand.Rand
+
+ packedRefsTimeout time.Duration
+}
+
+var (
+ _ refstore.ReadingStore = (*Store)(nil)
+ _ refstore.TransactionalStore = (*Store)(nil)
+ _ refstore.BatchStore = (*Store)(nil)
+)