Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Fields = [...]string{
fieldName,
fieldPath,
fieldContainer,
fieldSize,
fieldDate,
fieldTime,
fieldExt,
fieldExt2,
fieldType,
fieldArchive,
}
Fields is a slice of the constants that address fields in the FileInfo type.
Functions ¶
func Walk ¶
func Walk(root string, param WalkParams)
Walk is a function that performs a file search starting at the given root directory. See WalkParams to control the behavior of the search.
Types ¶
type FileInfo ¶
type FileInfo struct { Name string Path string ModTime time.Time Size int64 Type string Container string Archive string }
FileInfo is a type that represents information about a file or directory.
func (FileInfo) Context ¶
func (file FileInfo) Context() filter.VariableGetter
Context is a method of the FileInfo type that returns a VariableGetter function that can be used to retrieve the values of the fields of the file or directory represented by the FileInfo instance.
It also generates helper properties like "today".
type FindError ¶ added in v0.4.1
FindError is a type that represents an error that occurred during a file search.
type WalkParams ¶
type WalkParams struct { // Chan is the channel that is used to send the results of the search. Chan chan FileInfo // Err is the channel that is used to send error messages. Err chan string // Filter is the filter expression that is used to filter the results of the search. Filter *filter.FilterExpression // FollowSymlinks specifies whether symbolic links should be followed during the search. FollowSymlinks bool // NoArchive specifies whether archives should be skipped during the search. NoArchive bool }
WalkParams is used to specify the parameters for a file search.