walk

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 17 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
	Zip() ZipEntry
}

func NewEntry

func NewEntry(
	path string,
	info fs.FileInfo,
	zip ZipEntry,
) 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
}

type ZipEntry added in v0.5.0

type ZipEntry interface {
	Root() string
	RelPath() string
	CompressedSize() uint64
	UncompressedSize() uint64
	Comment() string
	NonUTF8() bool
}

func NewZipEntry added in v0.5.0

func NewZipEntry(
	root string,
	relPath string,
	compressedSize uint64,
	uncompressedSize uint64,
	comment string,
	nonUTF8 bool,
) ZipEntry

type ZipWalker added in v0.5.0

type ZipWalker struct {
	FileWalker
}

func NewZip added in v0.5.0

func NewZip(exclude expr.Expr) *ZipWalker

func (*ZipWalker) Walk added in v0.5.0

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

Jump to

Keyboard shortcuts

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