walker

package
v0.0.0-...-ac0478e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Walker package for fzd, which wraps github.com/karrick/godirwalk package for more similar interface as filepath.Walk

Index

Constants

This section is empty.

Variables

View Source
var SkipThis = godirwalk.SkipThis

SkipThis is used as return value from WalkFunc to indicate skipping particular file or directory

Functions

func Walk

func Walk(root string, fn WalkFunc) error

Walk walks the file tree rooted at the specified directory WalkFunc parameter will be called with specified directory path and each file/directory item within it

Types

type FileInfo

type FileInfo interface {
	Name() string      // base name of the file
	Mode() fs.FileMode // file mode bits
	IsDir() bool       // abbreviation for Mode().IsDir()
}

FileInfo is a subset of os.FileInfo interface

type WalkFunc

type WalkFunc func(path string, info FileInfo, err error) error

WalkFunc is the type of the function called by Walk to visit each file or directory, using own FileInfo interface

func Chain

func Chain(walkFuncs ...WalkFunc) WalkFunc

Chain to combine multiple WalkFuncs to one WalkFunc If one of the WalkFunc returned SkipThis, then WalkFunc chain will terminate early

Jump to

Keyboard shortcuts

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