cwalk

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: ISC, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferSize = NumWorkers

BufferSize defines the size of the job buffer

View Source
var ErrNotDir = errors.New("Not a directory")

ErrNotDir indicates that the path, which is being passed to a walker function, does not point to a directory

View Source
var NumWorkers = runtime.NumCPU() * 2

NumWorkers defines how many workers to run on each Walk() function invocation

Functions

func WalkDir

func WalkDir(root string, walkFn fs.WalkDirFunc) error

Types

type Walker

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

Walker is constructed for each Walk() function invocation

func (*Walker) Walk

func (w *Walker) Walk(relpath string, walkFn fs.WalkDirFunc) error

Walk recursively descends into subdirectories, calling walkFn for each file or directory in the tree, including the root directory.

type WalkerError

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

WalkerError struct stores individual errors reported from each worker routine

func (WalkerError) Error

func (we WalkerError) Error() string

Implement the error interface for WalkerError

type WalkerErrorList

type WalkerErrorList struct {
	ErrorList []WalkerError
}

WalkerErrorList struct store a list of errors reported from all worker routines

func (WalkerErrorList) Error

func (wel WalkerErrorList) Error() string

Implement the error interface fo WalkerErrorList

Jump to

Keyboard shortcuts

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