Documentation
¶
Index ¶
Constants ¶
View Source
const DIRECTORY_QUEUE_SIZE = 65536
How many directories to keep in queue
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryScanner ¶
type DirectoryScanner struct { Results chan FileInformation // Results Finished chan bool // Scanner has finished? Aborted chan bool // Scanner has aborted? Information chan workerInfo // Information about scan progress Errors chan error // Errors that happened during scanning FileValidatorFunc FileValidatorFunction // Function for file validation // contains filtered or unexported fields }
Always use New() to get proper scanner
func (*DirectoryScanner) Init ¶
func (s *DirectoryScanner) Init(workerCount int, fileValidatorFunc FileValidatorFunction) (err error)
Initialize workers
func (*DirectoryScanner) ScanDirectory ¶
func (s *DirectoryScanner) ScanDirectory(dir string) (err error)
ScanDirectory scans given directory and send results (file paths) to a channel
type FileInformation ¶
type FileInformation struct { Path string // Path to file Size uint64 // File size Identifier uint64 // Identifier (inode) Mode os.FileMode }
Information about a file
type FileValidatorFunction ¶
type FileValidatorFunction func(info FileInformation) bool
File validator signature
Click to show internal directories.
Click to hide internal directories.