print

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BySize is for sorting by size
	BySize string = "size"
	// ByCount is for sorting by count
	ByCount string = "count"
	// ByAge is for sorting by age
	ByAge string = "age"
	// ByName is for sorting by name
	ByName string = "name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionEntrySorter

type ExtensionEntrySorter struct {
	Slice  []*tree.ExtensionEntry
	Getter func(*tree.ExtensionEntry) float64
}

ExtensionEntrySorter sorts file entries

func (ExtensionEntrySorter) Len

func (p ExtensionEntrySorter) Len() int

func (ExtensionEntrySorter) Less

func (p ExtensionEntrySorter) Less(i, j int) bool

func (ExtensionEntrySorter) Sort

func (p ExtensionEntrySorter) Sort(cutoff float64) []*tree.ExtensionEntry

Sort sorts with a cutoff

func (ExtensionEntrySorter) Swap

func (p ExtensionEntrySorter) Swap(i, j int)

type FileEntrySorter

type FileEntrySorter struct {
	Slice  []*tree.FileTree
	Getter func(*tree.FileTree) float64
}

FileEntrySorter sorts file entries

func (FileEntrySorter) Len

func (p FileEntrySorter) Len() int

func (FileEntrySorter) Less

func (p FileEntrySorter) Less(i, j int) bool

func (FileEntrySorter) Sort

func (p FileEntrySorter) Sort(cutoff float64) []*tree.FileTree

Sort sorts with a cutoff

func (FileEntrySorter) Swap

func (p FileEntrySorter) Swap(i, j int)

type FileTreePrinter

type FileTreePrinter struct {
	SortBy        string
	Cutoff        float64
	ByExtension   bool
	Indent        int
	PrintTime     bool
	OnlyDirs      bool
	ColorExponent float64
	// contains filtered or unexported fields
}

FileTreePrinter prints a file tree in plain text format

func NewFileTreePrinter

func NewFileTreePrinter(byExt bool, cutoff float64, indent int, printTime bool, onlyDirs bool, colorExponent float64) FileTreePrinter

NewFileTreePrinter creates a new FileTreePrinter

func (FileTreePrinter) Print

func (p FileTreePrinter) Print(t *tree.FileTree) string

Print prints a FileTree

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.Tree[T]) string

type TreemapPrinter

type TreemapPrinter struct {
	ByExtension bool
	ByCount     bool
	HeatAge     bool
	OnlyDirs    bool
	// contains filtered or unexported fields
}

TreemapPrinter prints a tree in treemap CSV format

func NewTreemapPrinter

func NewTreemapPrinter(byExtension, byCount, heatAge, onlyDirs bool) TreemapPrinter

NewTreemapPrinter creates a new TreemapPrinter

func (TreemapPrinter) Print

func (p TreemapPrinter) Print(t *tree.FileTree) string

Print prints a FileTree

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL