Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreventDatalessMaterialization ¶ added in v0.3.0
func PreventDatalessMaterialization() error
PreventDatalessMaterialization is a no-op on platforms other than macOS.
Types ¶
type ByApparentSize ¶
type ByApparentSize Files
ByApparentSize sorts files by apparent size
func (ByApparentSize) Len ¶
func (f ByApparentSize) Len() int
func (ByApparentSize) Less ¶
func (f ByApparentSize) Less(i, j int) bool
func (ByApparentSize) Swap ¶
func (f ByApparentSize) Swap(i, j int)
type ByItemCount ¶
type ByItemCount Files
ByItemCount sorts files by item count
func (ByItemCount) Len ¶
func (f ByItemCount) Len() int
func (ByItemCount) Less ¶
func (f ByItemCount) Less(i, j int) bool
func (ByItemCount) Swap ¶
func (f ByItemCount) Swap(i, j int)
type Files ¶
type Files []Item
Files - slice of pointers to File
func (Files) FindByName ¶
FindByName searches name in Files and returns its index
func (Files) RemoveByName ¶
RemoveByName removes File from Files
type HardLinkedItems ¶
HardLinkedItems maps inode number to array of all hard linked items
type Item ¶
type Item interface {
GetPath() string
GetName() string
GetFlag() rune
IsDir() bool
GetSize() int64
GetType() string
GetUsage() int64
GetMtime() time.Time
GetItemCount() int64
GetParent() Item
SetParent(Item)
GetMultiLinkedInode() uint64
EncodeJSON(writer io.Writer, topLevel bool, attributes JSONAttributes) error
GetItemStats(linkedItems HardLinkedItems, filteringFiles bool) (itemCount int64, size, usage int64)
UpdateStats(linkedItems HardLinkedItems)
UpdateStatsWithFileFiltering(linkedItems HardLinkedItems)
AddFile(Item)
GetFiles(SortBy, SortOrder) iter.Seq[Item]
GetFilesLocked(SortBy, SortOrder) iter.Seq[Item]
RemoveFile(Item)
RemoveFileByName(name string)
RLock() func()
}
Item is a FS item (file or dir)
type JSONAttributes ¶ added in v0.3.0
type JSONAttributes map[string]struct{}
JSONAttributes selects optional attributes written to an analysis export. A nil set preserves the complete legacy export.
func (JSONAttributes) Includes ¶ added in v0.3.0
func (attributes JSONAttributes) Includes(attribute string) bool
Includes reports whether an optional JSON attribute should be written.
type SortOrder ¶
type SortOrder int
SortOrder represents the sort direction
func ParseSortOrder ¶
ParseSortOrder converts a string to SortOrder
type SymlinkItem ¶ added in v0.3.0
type SymlinkItem interface {
GetSymlinkTarget() string
}
SymlinkItem is an optional interface implemented by items that carry a symlink target. Consumers type-assert an Item to it to display the target (e.g. "name -> target"); items that are not symlinks return an empty string.