Documentation
¶
Overview ¶
internal/toposort/toposort.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TopologySort ¶
func TopologySort[T any](items []T, keyFn func(*T) string, depsFn func(*T) []string) (sorted []T, cyclic map[string]bool)
TopoSort performs Kahn's algorithm on a slice of items. keyFn extracts a unique string key for each item. depsFn extracts the dependency keys for each item. Returns items in topological order (dependencies first) and a set of keys in cycles.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.