Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtensionEntry ¶
type ExtensionEntry struct { Name string `json:"name"` Size int64 `json:"size"` Count int `json:"count"` Time time.Time `json:"time"` }
ExtensionEntry is a file tree entry for extensions
func (*ExtensionEntry) Add ¶ added in v0.2.0
func (e *ExtensionEntry) Add(size int64, count int, time tm.Time)
Add adds size and a count
func (ExtensionEntry) String ¶
func (e ExtensionEntry) String() string
type FileEntry ¶
type FileEntry struct { Name string `json:"name"` IsDir bool `json:"is_dir"` Size int64 `json:"size"` Count int `json:"count"` Time time.Time `json:"time"` Extensions map[string]*ExtensionEntry `json:"extensions"` }
FileEntry is a file tree entry
func NewFileEntry ¶
NewFileEntry creates a new FileEntry
func (*FileEntry) AddExtensions ¶
func (e *FileEntry) AddExtensions(ext map[string]*ExtensionEntry)
AddExtensions adds extensions
type FileTree ¶
FileTree is a tree with TreeEntry data
func Deserialize ¶
Deserialize a FileTree from a JSON byte slice
type PlainPrinter ¶
type PlainPrinter[T any] struct{}
PlainPrinter prints a tree in plain text format
func (PlainPrinter[T]) Print ¶
func (p PlainPrinter[T]) Print(t *Tree[T]) string
type Tree ¶
Tree is a tree data structure
func (*Tree[T]) Aggregate ¶
func (t *Tree[T]) Aggregate(fn func(parent, child T))
Aggregate aggregates tree branches
Click to show internal directories.
Click to hide internal directories.