scanner

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScanResult

type ScanResult struct {
	Path string
	Size int64
	Err  error
}

ScanResult contains a found path and its size

type Scanner

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

Scanner scans the filesystem concurrently for patterns

func NewScanner

func NewScanner() (*Scanner, error)

NewScanner creates a new Scanner with default configuration

func NewScannerWithDirs

func NewScannerWithDirs(dirs []string) (*Scanner, error)

NewScannerWithDirs creates a Scanner with custom search directories

func (*Scanner) AddSearchDir

func (s *Scanner) AddSearchDir(dir string) error

AddSearchDir adds a directory to the search list

func (*Scanner) FindByPattern

func (s *Scanner) FindByPattern(ctx context.Context, pattern string) <-chan ScanResult

FindByPattern searches for all files/directories matching the pattern Pattern can be: - A glob pattern like "node_modules" or "*.log" - A path pattern like "**/node_modules" for recursive search

func (*Scanner) FindByPatternInDir

func (s *Scanner) FindByPatternInDir(ctx context.Context, dir, pattern string) <-chan ScanResult

FindByPatternInDir searches for pattern in a specific directory

func (*Scanner) FindExactPath

func (s *Scanner) FindExactPath(path string) (ScanResult, error)

FindExactPath checks a single specific path and returns its size

func (*Scanner) FindMultiplePatterns

func (s *Scanner) FindMultiplePatterns(ctx context.Context, patterns []string) map[string]<-chan ScanResult

FindMultiplePatterns searches for multiple patterns concurrently

func (*Scanner) GetSearchDirs

func (s *Scanner) GetSearchDirs() []string

GetSearchDirs returns the directories that will be searched

func (*Scanner) SetWorkers

func (s *Scanner) SetWorkers(n int)

SetWorkers sets the number of concurrent workers

Jump to

Keyboard shortcuts

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