stats

package
v0.0.0-...-a14cbf1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicFile

type BasicFile struct {
	Path string
	Size int64
}

type WalkStats

type WalkStats struct {
	LargestFiles *[]BasicFile
	DuplicateMap *map[string][]BasicFile
}

func (*WalkStats) GetLargestDuplicates

func (w *WalkStats) GetLargestDuplicates(limit int) [][]BasicFile

Sort the stored duplicates and return them in sorted order (0 -> n, largest -> smallest) duplicate size = num_duplicates * duplicate_size

func (*WalkStats) UpdateDuplicates

func (w *WalkStats) UpdateDuplicates(fileHashBytes []byte, fileSize int64, filePath string)

Add a `BasicFile` record to the `DuplicateMap`

func (*WalkStats) UpdateLargestFiles

func (w *WalkStats) UpdateLargestFiles(file BasicFile)

Add a `BasicFile`, in decreasing size order, to the array of largest files up to `largestFilesLimit` (largest at index 0)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL