Documentation ¶
Index ¶
- func GenerateJSONReport(ctx context.Context, rootDir *Dir, rootPath string, maxDepth int, human bool) (string, error)
- func GenerateReport(ctx context.Context, rootDir *Dir, rootPath string, maxDepth int, human bool) (string, error)
- func PrintJSONReport(ctx context.Context, rootPath string, maxDepth int, human bool) error
- func PrintReport(ctx context.Context, rootPath string, maxDepth int, human bool) error
- type Dir
- type DirSlice
- type File
- type FileSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJSONReport ¶
func GenerateJSONReport(ctx context.Context, rootDir *Dir, rootPath string, maxDepth int, human bool) (string, error)
GenerateJSONReport generates and prints a JSON report of the disk usage in the given directory. maxDepth controls how many directory levels are displayed; if zero, there is no maximum depth. human causes the report to use human-readable units instead of raw bytes.
func GenerateReport ¶
func GenerateReport(ctx context.Context, rootDir *Dir, rootPath string, maxDepth int, human bool) (string, error)
GenerateReport generates a textual report of the disk usage in the given directory. maxDepth controls how many directory levels are displayed; if zero, there is no maximum depth. human causes the report to use human- readable units instead of raw bytes.
func PrintJSONReport ¶
PrintJSONReport generates and prints a JSON report of the disk usage in the given directory. maxDepth controls how many directory levels are displayed; if zero, there is no maximum depth. human causes the report to use human- readable units instead of raw bytes.
func PrintReport ¶
PrintReport generates and prints a textual report of the disk usage in the given directory. maxDepth controls how many directory levels are displayed; if zero, there is no maximum depth. human causes the report to use human- readable units instead of raw bytes.
Types ¶
type Dir ¶
Dir represents a directory and all of its files and subdirectories, along with their total counts and sizes.