Documentation
¶
Overview ¶
Package scanner will scan for files, and send the fileinfo onto a channel for DB insertion
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // FileTypeFile is a regular file FileTypeFile = FileType("FILE") // FileTypeSymLink is a symbolic link FileTypeSymLink = FileType("SYMLINK") // FileTypeDirectory is a regular directory FileTypeDirectory = FileType("DIRECTORY") // FileTypeArchive is an archive FileTypeArchive = FileType("ARCHIVE") // FileTypeDevice is a Device File FileTypeDevice = FileType("DEVICE") // FileTypeOther are Named Pipes, etc -- other non regular files FileTypeOther = FileType("OTHER") )
Functions ¶
This section is empty.
Types ¶
type FileFeed ¶
type FileFeed chan *ScannedObject
FileFeed is returned from Scan, and can be read to receive scanned objects.
type ScannedObject ¶
type ScannedObject struct { Error error // If this is set, then there was an error, and the scanner is likely dead Path string FileInfo os.FileInfo FileType FileType // DIR, FILE, ARCHIVE ArchiveError error // If set, something is wrong with archive Children []*ScannedObject // Holds children of an archive }
ScannedObject holds information about a file or archive
func (*ScannedObject) Dump ¶
func (so *ScannedObject) Dump(verbose bool)
Dump displays the scanned object to stdout
func (*ScannedObject) SetFileType ¶
func (so *ScannedObject) SetFileType() error
SetFileType will set our type based on the file mode
type Scanner ¶
type Scanner struct { RootPath string FollowSymlinks bool // If true, will follow symlinks OneFilesystem bool // If true, will not jump filesystems // contains filtered or unexported fields }
Scanner holds a scanner's state, etc
func (*Scanner) Scan ¶
Scan will return a channel to read from to receive files as they're being scanned.
func (*Scanner) ScanInsert ¶
ScanInsert will kick off a scan, and insert all records into the database
Click to show internal directories.
Click to hide internal directories.