Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Walk ¶
Walk traverses the entries in 'names' in a concurrent fashion and returns results in a channel of Result. The caller must service the channel. Any errors encountered during the walk are returned in the error channel.
func WalkFunc ¶ added in v0.4.0
WalkFunc traverses the entries in 'names' in a concurrent fashion and calls 'apply' for entries that match criteria in 'opt'. The apply function must be concurrency-safe ie it will be called concurrently from multiple go-routines. Any errors reported by 'apply' will be returned from WalkFunc().
Types ¶
type Options ¶
type Options struct { // Follow symlinks if set FollowSymlinks bool // stay within the same file-system OneFS bool // if set, return xattr for every returned result Xattr bool // Types of entries to return Type Type // Excludes is a list of shell-glob patterns to exclude from // the walk. If a dir matches the prefix, go-walk does // not descend that subdirectory. Excludes []string // Filter is an optional caller provided callback // This function must return True if this entry should // no longer be processed. ie filtered out. Filter func(nm string, fi os.FileInfo) bool }
Options control the behavior of the filesystem walk
type Result ¶
type Result struct { // path relative to the supplied argument Path string // stat(2) info Stat os.FileInfo // extended attributes for this file // set only if user requests it Xattr Xattr }
Result is the data returned as part of the directory walk
Click to show internal directories.
Click to hide internal directories.