blob: f9dab764ca899af3942cfb841dfa960e8d6c120d (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Package reachability traverses the object graph to test relationships and emit object lists.
package reachability
import (
commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
"codeberg.org/lindenii/furgit/objectstore"
)
// Reachability provides graph traversal over objects in one object store.
//
// It is not safe for concurrent use.
type Reachability struct {
store objectstore.Store
graph *commitgraphread.Reader
}
// New builds a Reachability over one object store.
func New(store objectstore.Store) *Reachability {
return &Reachability{store: store}
}
// NewWithCommitGraph builds a Reachability over one object store with an
// optional commit-graph reader for faster commit-domain traversal.
func NewWithCommitGraph(store objectstore.Store, graph *commitgraphread.Reader) *Reachability {
return &Reachability{store: store, graph: graph}
}
|