types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoFormat

func NoFormat(size int64) string

func SizeFormatterBytes

func SizeFormatterBytes(size int64) string

func SizeFormatterPow10

func SizeFormatterPow10(size int64) string

Types

type Node

type Node struct {
	Name string
	Mode os.FileMode
	Size int64

	SizeOnDisk int64

	IsDir            bool
	LastModification time.Time
	Children         []*Node
	Parent           *Node
	// contains filtered or unexported fields
}

func (*Node) AddChild

func (n *Node) AddChild(child *Node)

func (*Node) CloneDirectoryStructure

func (n *Node) CloneDirectoryStructure() (*Node, error)

func (*Node) CreateChild

func (n *Node) CreateChild(fileName, parentPath string) error

func (*Node) FileCount

func (n *Node) FileCount() int

func (*Node) GetFileType

func (n *Node) GetFileType(parentPath string) (string, error)

func (*Node) IncrementSize

func (n *Node) IncrementSize(size int64)

func (*Node) Info

func (n *Node) Info() string

func (*Node) InfoWithSizeFormatter

func (n *Node) InfoWithSizeFormatter(f SizeFormatter) string

func (*Node) NewFilteredTree

func (n *Node) NewFilteredTree(opts *TreeFilterOptions) (*Node, error)

func (*Node) Print

func (n *Node) Print()

func (*Node) PrintWithSizeFormatter

func (n *Node) PrintWithSizeFormatter(f SizeFormatter)

func (*Node) RelativePath

func (n *Node) RelativePath(parent string) string

func (*Node) Remove

func (n *Node) Remove(parentPath string) error

func (*Node) RemoveChild

func (n *Node) RemoveChild(c *Node)

func (*Node) SortChildrenBySizeOnDisk

func (n *Node) SortChildrenBySizeOnDisk()

type SizeFormatter

type SizeFormatter func(int64) string

type TreeFilterOptions

type TreeFilterOptions struct {
	// contains filtered or unexported fields
}

func NewTreeFilterOpts

func NewTreeFilterOpts(nameContains, reMatches string, caseInsensitive, invert bool) (*TreeFilterOptions, error)

func (*TreeFilterOptions) CheckNameContains

func (o *TreeFilterOptions) CheckNameContains(original string) bool

func (*TreeFilterOptions) CheckRegexMatches

func (o *TreeFilterOptions) CheckRegexMatches(original string) bool

func (*TreeFilterOptions) IsNoOp

func (o *TreeFilterOptions) IsNoOp() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳