Documentation
¶
Overview ¶
Package engine wires the scan → rules passes into a single ordered item list, shared by the TUI and the JSON serve mode. No terminal dependency.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoSafeSelection ¶
AutoSafeSelection picks regenerable SAFE path items (no REVIEW/KEEP, no tool-commands) — the set `--yes` and the GUI's default selection clean.
func FindProjects ¶ added in v0.2.1
FindProjects walks root depth-first for directories named "node_modules" without recursing into a found one, streaming each via onItem. It stays on a single filesystem, skips symlinked dirs, tolerates permission errors, and stops early when cancel is closed (nil = never).
func ScanAll ¶
func ScanAll(goos, home string, system bool, onItem func(rules.Item), cancel <-chan struct{}, excludes []string) []rules.Item
ScanAll runs the catalog pass then the heuristic pass, de-duped and sorted. onItem (may be nil) is called for each item as it is discovered, so a UI can stream rows in. Catalog items stream as they are measured; heuristic (top-N) items stream after. cancel (may be nil) aborts the scan early, returning whatever was collected so far.
Types ¶
type Node ¶ added in v0.5.0
type Node struct {
Name string `json:"name"`
Path string `json:"path"`
Bytes int64 `json:"bytes"`
Dir bool `json:"dir"`
Children []*Node `json:"children,omitempty"`
}
Node is a directory or file in the disk-map size tree. Aggregate ("+N small") nodes have an empty Path and Dir=false.
func BuildSizeTree ¶ added in v0.5.0
func BuildSizeTree(root string, excludes []string, onProgress func(scanned int, bytes int64, path string), cancel <-chan struct{}) *Node
BuildSizeTree walks root once and returns a pruned size tree for a treemap. Excluded subtrees, symlinks, and other devices are skipped; unreadable entries are skipped best-effort; the walk stops when cancel is closed.
type Project ¶ added in v0.2.1
type Project struct {
Path string // absolute path to the artifact dir (removed when cleaned)
Dir string // absolute path to the parent project dir (for the label)
Kind string // node_modules | .next | dist | build | target | __pycache__ | ...
Bytes int64
Modified int64 // unix secs: newest mtime among the project dir's non-artifact children
}
Project is one regenerable artifact directory found under a root.