Documentation ¶
Overview ¶
Package fileio provides functionality to interact with the OSs filesystem. This includes iteration over (parts of) the filesystem, as well as enumeration of network shares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // FilesBuffer sets how many files can be buffered at one time // during iteration. FilesBuffer = 8 )
Functions ¶
func DriveTypeNames ¶
func DriveTypeNames() []string
DriveTypeNames returns a list of possible string values of DriveType.
Types ¶
type DriveType ¶
type DriveType int
DriveType describes the type of a system drive.
ENUM( Unknown=0 Removable=1 Fixed=2 Remote=4 CDRom=8 RAM=16 )
const ( // DriveTypeUnknown is a DriveType of type Unknown DriveTypeUnknown DriveType = iota // DriveTypeRemovable is a DriveType of type Removable DriveTypeRemovable // DriveTypeFixed is a DriveType of type Fixed DriveTypeFixed // DriveTypeRemote is a DriveType of type Remote DriveTypeRemote DriveType = iota + 1 // DriveTypeCDRom is a DriveType of type CDRom DriveTypeCDRom DriveType = iota + 4 // DriveTypeRAM is a DriveType of type RAM DriveTypeRAM DriveType = iota + 11 )
func ParseDriveType ¶
ParseDriveType attempts to convert a string to a DriveType
func (DriveType) MarshalText ¶
MarshalText implements the text marshaller method
func (*DriveType) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method
type FSScanProgress ¶
FSScanProgress provides information about the scanning progress.
type FSScanner ¶
type FSScanner struct { NGoroutines int // contains filtered or unexported fields }
FSScanner is a scanner for the filesystem.
func NewFSScanner ¶
func NewFSScanner(scanner FileScanner) *FSScanner
NewFSScanner create a new FSScanner, which will use the given FileScanner to scan any encountered file.
type FileScanner ¶
FileScanner provides functionality to scan files.
type Iterator ¶
Iterator provides capability to iterate over files.
func Concat ¶
Concat concatenates multiple Iterators. When one Iterator is exhausted, the next one is used.
func Concurrent ¶
Concurrent combines the given Iterators concurrently. Each given Iterator will run in its own goroutine.
func IteratePath ¶
IteratePath starts an asynchronous, recursive Iterator over all files and subdirectores in the given path. For each file with one of the given validExtensions, a File will be emitted, which can be read using Iterator.Next.