ref: b90593c9b83f71de343e27cd1b489dff79bd4ac7
dir: /reachability/reachability.go/
// Package reachability traverses the object graph to test relationships and emit object lists.
package reachability
import (
commitgraphread "codeberg.org/lindenii/furgit/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}
}