Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonDirStats ¶
type CommonDirStats struct { // Size is the total size of children, in bytes. Size int64 `json:"s"` // Files is the number of child regular files. Files int `json:"fc"` // Directories is the number of child directories. Directories int `json:"dc"` // Extensions is the size and number of children, grouped by file extension. Extensions map[string]*CountSize `json:"e"` // ModificationYears is the size and number of children, grouped by modification year. ModificationYears map[int]*CountSize `json:"y"` }
CommonDirStats are common statistics between direct and recursive directory statistics.
type CountSize ¶
type CountSize struct { // Count is the number of files. Count int `json:"fc"` // Size the size of files, in bytes. Size int64 `json:"s"` }
CountSize indicates a number of files and a size, in bytes.
type DateTime ¶
DateTime is the time structure with a custom marshal format.
func (DateTime) MarshalJSON ¶
MarshalJSON marshals the time with the RFC3339 format.
type DirectStats ¶
type DirectStats struct { CommonDirStats // Children is the list of direct child files indexes. Children []int `json:"c"` }
DirectStats are directory statistics about direct child files.
type FileStat ¶
type FileStat struct { // Path is the path to the file (absolute for the root directory, relative for other). Path string `json:"p"` // Name is the name of the file. Name string `json:"n"` // Extension is the extension part of the file name, including the leading dot. Extension string `json:"e"` // Type is the type of the file (regular file or directory). Type string `json:"t"` // Size is the size of the file, in bytes. Size int64 `json:"s"` // LastWriteTime is the time the current file was last written (contents changed). LastWriteTime DateTime `json:"m"` // Direct is the statistics object about direct child files. Direct *DirectStats `json:"d,omitempty"` // Recursive is the statistics object about direct and indirect child files. Recursive *RecursiveStats `json:"r,omitempty"` }
FileStat stores basic information and statistics about a file.
func NewDirectoryStat ¶
NewDirectoryStat creates a new file statistics object for a directory.
func NewFileStat ¶
NewFileStat creates a new file statistics object for a regular file.
type Range ¶
type Range struct { // Start is the start index (inclusive). Start int `json:"s"` // End is the end index (exclusive). End int `json:"e"` }
Range is a range of item indexes.
type RecursiveStats ¶
type RecursiveStats struct { CommonDirStats // Depth is the maximum level of nesting in the current directory. Depth int `json:"d"` // Children is the range of direct and indirect child files. Children Range `json:"c"` }
RecursiveStats are directory statistics about direct and indirect child files.