Documentation
¶
Index ¶
Constants ¶
const DepthDefault = 1 //default depth in results
DepthDefault - default Depth value
const LimitDefault = 10 //default value for a arglimit
LimitDefault - default Limit value
const SortDefault = "size_desc"
SortDefault - default Sort value
Variables ¶
This section is empty.
Functions ¶
func AddPathSeparator ¶
AddPathSeparator - add os path separator to string
func GetAdaptedSize ¶
GetAdaptedSize - get file size adapted to InputArgs.FixUnit units or to a flexible useful units
Types ¶
type OverallInfo ¶
type OverallInfo struct {
// contains filtered or unexported fields
}
OverallInfo -
func (*OverallInfo) PrintOverallInfo ¶
func (info *OverallInfo) PrintOverallInfo()
PrintOverallInfo -
type TFile ¶
type TFile struct {
RelativePath string
Name string
Size int64
IsDir bool
IsLink bool
LinkedDirPath string
Depth int
IsNotAccessible bool
IsNotAccessibleMessage string
AdaptedSize float64
AdaptedUnit string
}
TFile - struct for file object
func (*TFile) SetAdaptedSizeOfFile ¶
func (file *TFile) SetAdaptedSizeOfFile(inputArgs *TInputArgs)
SetAdaptedSizeOfFile - set file properties: AdaptedSize & AdaptedUnit
type TFiles ¶
type TFiles []TFile
TFiles - struct for files array object
func (*TFiles) CalculateMaxLenFilename ¶
CalculateMaxLenFilename - calculating max length filename in files
func (*TFiles) GetOverallInfo ¶
func (files *TFiles) GetOverallInfo(totalTime time.Duration) *OverallInfo
GetOverallInfo -
func (*TFiles) PrintFilesSizes ¶
func (files *TFiles) PrintFilesSizes()
PrintFilesSizes - print out sizes of files
type TInputArgs ¶
type TInputArgs struct {
Path string //analysed path
Limit int //limit folders in results
Depth int //depth of subfolders in results (-1 - all, 1 - only current, 2 and more - 2 and more)
FixUnit string //fixed size unit in a results presetation (b, Kb, Mb, ...). Has a upper priority than "argmaxunit". Must be in sizeUnits.
Sort string //results sorting by
}
TInputArgs - the programm arguments
var InputArgs TInputArgs
InputArgs - input arguments
func (TInputArgs) PrintArguments ¶
func (t TInputArgs) PrintArguments()
PrintArguments - print arguments
func (*TInputArgs) SetDepth ¶
func (t *TInputArgs) SetDepth(depth *int) error
SetDepth - init Depth field
func (*TInputArgs) SetFixUnit ¶
func (t *TInputArgs) SetFixUnit(fixunit *string) error
SetFixUnit - init FixUnit field
func (*TInputArgs) SetLimit ¶
func (t *TInputArgs) SetLimit(limit *int) error
SetLimit - init Limit field
func (*TInputArgs) SetPath ¶
func (t *TInputArgs) SetPath(inpath *string) error
SetPath - init Path field
func (*TInputArgs) SetSort ¶ added in v1.3.2
func (t *TInputArgs) SetSort(sort *string) error
SetSort - init Sort field