walk

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WalkCount           = metric.NewCounter("Walk")
	WalkCallCount       = metric.NewCounter("WalkCall")
	WalkDirCount        = metric.NewCounter("WalkDir")
	WalkEntryCount      = metric.NewCounter("WalkEntry")
	WalkExcludeCount    = metric.NewCounter("WalkExclude")
	WalkExcludeErrCount = metric.NewCounter("WalkExcludeErr")
)

Functions

func GetPathFromMetadata

func GetPathFromMetadata(v *meta.Data) string

func NewMetaData

func NewMetaData(entry Entry) *meta.Data

Types

type Entry

type Entry interface {
	Path() string
	Info() fs.FileInfo
}

func NewEntry

func NewEntry(
	path string,
	info fs.FileInfo,
) Entry

type FileWalker

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

FileWalker walks only files under the root.

func NewFile

func NewFile(exclude expr.Expr) *FileWalker

func (FileWalker) Err

func (w FileWalker) Err() error

func (*FileWalker) Walk

func (w *FileWalker) Walk(root string) iter.Seq[Entry]

type ReaderWalker

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

ReaderWalker receives paths from io.Reader and walks under them.

func NewReader

func NewReader(r io.Reader, fileWalker Walker) *ReaderWalker

func (ReaderWalker) Err

func (w ReaderWalker) Err() error

func (*ReaderWalker) Walk

func (w *ReaderWalker) Walk(_ string) iter.Seq[Entry]

type Walker

type Walker interface {
	Walk(root string) iter.Seq[Entry]
	Err() error
}

Jump to

Keyboard shortcuts

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