concurrent

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonUTF8File = errors.New("file contains non-UTF8 content")
)

Functions

func DiscoverFiles

func DiscoverFiles(
	rootPath string,
	matcher *ignorer.Matcher,
	jobChan chan<- domain.FileJob,
	asciiOnly bool,
	sequenceConfig domain.SequenceConfig,
	collector *ResultCollector,
	progressCallback ProgressCallback,
	errorCallback func(error),
)

Types

type DirectoryWalker added in v0.2.1

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

func NewDirectoryWalker added in v0.2.1

func NewDirectoryWalker(matcher *ignorer.Matcher) *DirectoryWalker

func (*DirectoryWalker) WalkAndProcess added in v0.2.1

func (dw *DirectoryWalker) WalkAndProcess(
	rootPath string,
	jobChan chan<- domain.FileJob,
	asciiOnly bool,
	sequenceConfig domain.SequenceConfig,
	collector *ResultCollector,
	progressCallback ProgressCallback,
	errorCallback func(error),
)

type FileData added in v0.2.1

type FileData struct {
	Path    string
	Content []byte
	Size    int
}

type FileService added in v0.2.1

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

func NewFileService added in v0.2.1

func NewFileService(matcher *ignorer.Matcher) *FileService

func (*FileService) LoadGitignoreForDirectory added in v0.2.1

func (fs *FileService) LoadGitignoreForDirectory(path string) error

func (*FileService) ReadFile added in v0.2.1

func (fs *FileService) ReadFile(path string) (*FileData, error)

func (*FileService) ShouldIgnoreFile added in v0.2.1

func (fs *FileService) ShouldIgnoreFile(path string) (bool, ignorer.MatcherDecider)

type ProgressCallback added in v0.0.6

type ProgressCallback func(filesFound, filesProcessed int)

type ResultCollector

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

func NewResultCollector

func NewResultCollector() *ResultCollector

func (*ResultCollector) AddResult

func (rc *ResultCollector) AddResult(result domain.CharCountResult)

func (*ResultCollector) GetResults

func (rc *ResultCollector) GetResults() (
	map[rune]int,
	map[uint16]uint32,
	map[uint32]uint32,
	int,
	int,
	int,
	int,
	ResultTiming,
)

func (*ResultCollector) IncrementFound added in v0.0.5

func (rc *ResultCollector) IncrementFound()

func (*ResultCollector) IncrementIgnored added in v0.0.5

func (rc *ResultCollector) IncrementIgnored()

type ResultTiming added in v0.2.0

type ResultTiming struct {
	Values map[string]time.Duration
}

type Worker added in v0.2.0

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

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(workerCount int, jobBufferSize int, processor *processor.FileProcessor) *WorkerPool

func (*WorkerPool) AddJob

func (wp *WorkerPool) AddJob(job domain.FileJob)

func (*WorkerPool) CloseJobs

func (wp *WorkerPool) CloseJobs()

func (*WorkerPool) Done

func (wp *WorkerPool) Done() <-chan bool

func (*WorkerPool) Jobs

func (wp *WorkerPool) Jobs() chan<- domain.FileJob

func (*WorkerPool) Results

func (wp *WorkerPool) Results() <-chan domain.CharCountResult

func (*WorkerPool) Start

func (wp *WorkerPool) Start()

Jump to

Keyboard shortcuts

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