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"` }
ExtensionEntry is a file tree entry for extensions
func (*ExtensionEntry) AddMulti ¶
func (e *ExtensionEntry) AddMulti(size int64, count int)
AddMulti 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"` 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 JSONPrinter ¶
type JSONPrinter[T any] struct{}
JSONPrinter prints a tree in JSON format
func (JSONPrinter[T]) Print ¶
func (p JSONPrinter[T]) Print(t *Tree[T]) string
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
type TreemapPrinter ¶
TreemapPrinter prints a tree in treemap CSV format
func (TreemapPrinter) Print ¶
func (p TreemapPrinter) Print(t *FileTree) string
Print prints a FileTree
Click to show internal directories.
Click to hide internal directories.