walker

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: BSD-2-Clause, CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const XbWalkName = ".xbwalk"

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	os.FileInfo
	Path       string
	NamePrefix []string
}

func (FileInfo) SetNamePrefix

func (info FileInfo) SetNamePrefix(prefix ...string) FileInfo

type WalkCallback

type WalkCallback = func(info FileInfo) error

type WalkFunc

type WalkFunc = func(visited *map[string]bool, recursive bool, cb WalkCallback) (err error)

type Walker

type Walker struct {
	Recursive    bool
	VisitedPaths *map[string]bool
	IgnoreNames  map[string]bool
	IgnorePaths  map[string]bool
	IgnoreRes    []*regexp.Regexp
	IgnoreGlobs  []glob.Glob
	IgnoreFuncs  []func(pth string) bool
	// contains filtered or unexported fields
}

func New

func New() *Walker

func (Walker) Accepts

func (w Walker) Accepts(pth string) bool

func (*Walker) DefaultIgnores

func (w *Walker) DefaultIgnores() *Walker

func (*Walker) IgnoreFunc

func (w *Walker) IgnoreFunc(f ...func(pth string) bool) *Walker

func (*Walker) IgnoreGlob

func (w *Walker) IgnoreGlob(g ...glob.Glob) *Walker

func (*Walker) IgnoreGlobS

func (w *Walker) IgnoreGlobS(pattern ...string) *Walker

func (*Walker) IgnoreName

func (w *Walker) IgnoreName(names ...string) *Walker

func (*Walker) IgnorePath

func (w *Walker) IgnorePath(pth ...string) *Walker

func (*Walker) IgnoreRe

func (w *Walker) IgnoreRe(re ...*regexp.Regexp) *Walker

func (*Walker) IgnoreReS

func (w *Walker) IgnoreReS(pattern ...string) *Walker

func (*Walker) Recursives

func (w *Walker) Recursives() *Walker

func (Walker) Walk

func (w Walker) Walk(dirpath string, cb WalkCallback) (err error)

find now

Jump to

Keyboard shortcuts

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