pathwalk

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AltWalker

type AltWalker struct {
	Root    string
	Options *Options
	Sync    chan bool
	Output  chan<- *File
	Wait    *sync.WaitGroup
}

AltWalker is an alternate walker that walks the path concurrently without opening too many simultaneous files

func (*AltWalker) Walk

func (p *AltWalker) Walk()

Walk walks the path with goroutine per directory

type File

type File struct {
	Path     string
	Size     int64
	ModTime  time.Time
	ProcTime time.Duration
	Error    error
}

File object returned by Walker.Walk method

type Options

type Options struct {
	Pattern string

	Recurse     bool
	Parallel    int
	HiddenDirs  bool
	HiddenFiles bool
	IncludeGit  bool
	// contains filtered or unexported fields
}

Options for PathWalker implementations

type PathWalker

type PathWalker interface {
	Walk()
}

PathWalker interface

func NewAltWalker

func NewAltWalker(root string, options *Options, output chan<- *File, wg *sync.WaitGroup) PathWalker

NewAltWalker is the constructor for the AltWalker type

func NewWalker

func NewWalker(root string, options *Options, output chan<- *File, wg *sync.WaitGroup) PathWalker

NewWalker returns a new Walker

type Walker

type Walker struct {
	Root    string
	Options *Options
	Output  chan<- *File
	Wait    *sync.WaitGroup
}

Walker object

func (*Walker) Walk

func (p *Walker) Walk()

Walk the path

Jump to

Keyboard shortcuts

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