aboutsummaryrefslogtreecommitdiff
path: root/reachability/walk.go
diff options
context:
space:
mode:
Diffstat (limited to 'reachability/walk.go')
-rw-r--r--reachability/walk.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/reachability/walk.go b/reachability/walk.go
index 13400e89..e6de8684 100644
--- a/reachability/walk.go
+++ b/reachability/walk.go
@@ -15,3 +15,23 @@ type Walk struct {
seqUsed bool
err error
}
+
+// Walk creates one single-use traversal over the selected domain.
+//
+// In DomainCommits, when a commit-graph reader is attached, parent expansion
+// may use commit-graph metadata for speed.
+func (r *Reachability) Walk(domain Domain, haves, wants map[objectid.ObjectID]struct{}) *Walk {
+ walk := &Walk{
+ reachability: r,
+ domain: domain,
+ haves: haves,
+ wants: wants,
+ }
+
+ err := validateDomain(domain)
+ if err != nil {
+ walk.err = err
+ }
+
+ return walk
+}