aboutsummaryrefslogtreecommitdiff
path: root/commitquery/queries.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-28 17:40:02 +0000
committerGravatar Runxi Yu2026-03-28 17:40:02 +0000
commit06583274fa64ad6677773bf4ca54f69226388203 (patch)
tree66354bf972d267bf7ee5135eb7e5b90c31f9fe4d /commitquery/queries.go
parentformat/commitgraph/read: Lifetime (diff)
signatureNo signature
commitquery: Make a reusable engine thingy
Diffstat (limited to 'commitquery/queries.go')
-rw-r--r--commitquery/queries.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/commitquery/queries.go b/commitquery/queries.go
new file mode 100644
index 00000000..dec8606f
--- /dev/null
+++ b/commitquery/queries.go
@@ -0,0 +1,23 @@
+package commitquery
+
+import (
+ "sync"
+
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
+ objectstore "codeberg.org/lindenii/furgit/object/store"
+)
+
+// Queries provides commit-domain queries over one object store
+// and optional commit-graph reader.
+//
+// Queries reuses internal mutable query workers across operations.
+//
+// Labels: MT-Safe.
+type Queries struct {
+ store objectstore.ReadingStore
+ graph *commitgraphread.Reader
+
+ mu sync.Mutex
+ idle []*query
+ maxIdle int
+}