dir_tree

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DTree

type DTree struct {
	Root string
	// contains filtered or unexported fields
}

func NewTree

func NewTree(root string, hf HandlerFunc, opts ...Option) *DTree

func (*DTree) Tree

func (dt *DTree) Tree()

type HandlerFunc

type HandlerFunc struct {
	DirFunc    func(obj *TreeItem)
	FileFunc   func(obj *TreeItem)
	FinishFunc func()
}

type Option

type Option func(o *option)

func WithDefaultExclude

func WithDefaultExclude() Option

func WithDepth

func WithDepth(depth int) Option

func WithExcludeDir

func WithExcludeDir(exclude []string) Option

func WithExcludePrefix

func WithExcludePrefix(list ...string) Option

func WithExcludeSuffix

func WithExcludeSuffix(list ...string) Option

func WithExcludeUnknown

func WithExcludeUnknown(exclude bool) Option

func WithOnlyDir

func WithOnlyDir() Option

func WithProgressBarOut

func WithProgressBarOut() Option

func WithSyncFileOpMode

func WithSyncFileOpMode() Option

func WithSyncMode

func WithSyncMode() Option

func WithTargetExt

func WithTargetExt(ext string) Option

func WithWorkerCount

func WithWorkerCount(count int) Option

type TreeItem

type TreeItem struct {
	Fs     fs.FileInfo
	Parent string
	Ext    string
	Depth  int
}

func (*TreeItem) Abs

func (t *TreeItem) Abs() string

func (*TreeItem) IsDir

func (t *TreeItem) IsDir() bool

func (*TreeItem) IsFile

func (t *TreeItem) IsFile() bool
func (t *TreeItem) IsSymlink() bool

func (*TreeItem) Name

func (t *TreeItem) Name() string

Jump to

Keyboard shortcuts

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