walk

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathPredicate

type PathPredicate func(path string, info os.FileInfo) bool

PathPredicate performs a test against a file being walked

func (PathPredicate) Not

func (a PathPredicate) Not() PathPredicate

Not negates a PathPredicate

type PathWalker

type PathWalker func(path string, info os.FileInfo) error

PathWalker performs a function against a file being walked

func NewPathWalker

func NewPathWalker() PathWalker

NewPathWalker creates a new PathWalker

func (PathWalker) Do

func (a PathWalker) Do(path string, info os.FileInfo) error

Do will call a PathWalker. If the walker is null then null is returned.

func (a PathWalker) FollowSymlinks() PathWalker

FollowSymlinks will cause the walker to follow a symlink, unlike filepath.Walk() with refuses to do do.

func (PathWalker) If

If will test a path with a PathPredicate and allow the path to be processed only if the PathPredicate passes

func (PathWalker) IfNot

func (a PathWalker) IfNot(p PathPredicate) PathWalker

IfNot is the same as If except only allows processing to continue if the PathPredicate returns false

func (PathWalker) IsDir

func (a PathWalker) IsDir() PathWalker

IsDir allows processing only if the current path is a Directory

func (PathWalker) IsFile

func (a PathWalker) IsFile() PathWalker

IsFile allows processing only if the current path is a File

func (PathWalker) PathContains

func (a PathWalker) PathContains(s string) PathWalker

PathContains allows processing if the path contains the provided string

func (PathWalker) PathHasNotSuffix

func (a PathWalker) PathHasNotSuffix(s string) PathWalker

PathHasNotSuffix allows processing if the path has not got the provided suffix

func (PathWalker) PathHasSuffix

func (a PathWalker) PathHasSuffix(s string) PathWalker

PathHasSuffix allows processing if the path has the provided suffix

func (PathWalker) PathNotContain

func (a PathWalker) PathNotContain(s string) PathWalker

PathNotContain allows processing if the path does not contain the provided string

func (PathWalker) Then

func (a PathWalker) Then(b PathWalker) PathWalker

Then performs the current PathWalker then another PathWalker

func (PathWalker) Walk

func (a PathWalker) Walk(root string) error

Walk performs the actual walk against the built PathWalker

Jump to

Keyboard shortcuts

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