diff --git a/internal/config/dag/dag.go b/internal/config/dag/dag.go index b90e5bd..46c7676 100644 --- a/internal/config/dag/dag.go +++ b/internal/config/dag/dag.go @@ -95,12 +95,15 @@ func (d *DAG) getVertexID(s string) string { return "" } +// WalkFunc represents a function that implements a visitor. type WalkFunc func(vertexID string, vertex interface{}) +// Visit executes the visitor function. func (fn WalkFunc) Visit(v hdag.Vertexer) { fn(v.Vertex()) } +// DFSWalk walks the [DAG] using a depth first strategy. func (d *DAG) DFSWalk(fn WalkFunc) { d.dag.DFSWalk(fn) }