filewalker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStats

func NewStats() *stats

Types

type FileIndex

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

func NewFileIndex

func NewFileIndex(newIndex bool, subdir string) (idx *FileIndex, err error)

func (*FileIndex) Close

func (idx *FileIndex) Close()

func (*FileIndex) GetFileStats

func (idx *FileIndex) GetFileStats(key string) Result

func (*FileIndex) SaveFileStats

func (idx *FileIndex) SaveFileStats(key string, result Result)

type FileWalker

type FileWalker interface {
	Walk(ctx context.Context, stats Stats) error
}

func New

func New(paths []string, recursive, followSymlinks bool, suffixes []string, concurrency int, fn func(path string) Result) FileWalker

func NewFromViper

func NewFromViper(cmd string, paths []string, fn func(path string) Result) FileWalker

type Result

type Result interface {
	fmt.Stringer
	Log(fileNum int) string
	GetStats() Stats
	IncrRecords()
	IncrProcessed()
	IncrDuplicates()
	AddError(err error)
	Records() int64
	Processed() int64
	ErrorCount() int64
	Errors() []error
	SetFatal(error)
	Fatal() error
	Duplicates() int64
	error
}

func NewResult

func NewResult(fileName string) Result

type Stats

type Stats interface {
	fmt.Stringer
	Merge(s Stats)
}

Jump to

Keyboard shortcuts

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