walker

package
v0.0.0-...-30c4c12 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Walker

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

Walker walks a recursive directory hierarchy, exposing a scanner-like interface.

func (*Walker) Err

func (w *Walker) Err() error

Err returns the first error that occurred while scanning.

func (*Walker) Info

func (w *Walker) Info() os.FileInfo

Info returns the os.FileInfo for the most recent path scanned.

func (*Walker) Init

func (w *Walker) Init(root string)

Init initializes a walker to walk from a root path.

func (*Walker) Path

func (w *Walker) Path() string

Path returns the most recent path that was scanned.

func (*Walker) Relpath

func (w *Walker) Relpath() string

Relpath returns the most recent path that was scanned, relative to the scan root directory.

func (*Walker) Scan

func (w *Walker) Scan() bool

Scan advances the walker to the next entry in the hierarchy. It returns false either when the scan stops because we have reached the end of the input or else because there was error. After Scan returns, the Err method returns any error that occurred during scanning.

Jump to

Keyboard shortcuts

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