Documentation
¶
Index ¶
- func Copy(ctx Context, dst chan<- Item, src <-chan Item) bool
- func Entries(ctx context.Context, c <-chan Item) <-chan ItemInfo
- func Filter(ctx context.Context, src <-chan Item, accept func(Item) bool) <-chan Item
- func Walk(ctx Context, path string, blockSize int) <-chan Item
- type Answer
- type Context
- type FS
- type Item
- type ItemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Answer ¶
type Answer int
const ( // Quit requests the sender to stop sending data. Quit Answer = iota // Down requests the sender to show the contents // of the item. This should only be used to reply // to directory entry items. Down // Next requests that the sender send the next // item without descending into it. Next // Skip requests that the sender skip over // all remaining items in the current file or directory. Skip )
type Item ¶
type Item struct { // Dir holds information about a file. // It is nil when sending a file's data. Dir os.FileInfo // Path holds the full path of the item, or the empty string // if Dir is nil. Path string // Data holds a file's data block. Data []byte // Answer must be used to send a reply // to the item. Reply chan<- Answer }
Item represents an item of filesystem data. If Dir is non-nil, the item represents a directory entry. If Data is non-empty, the item represents a data block.
When an item is received, the receiver is expected to send on the reply channel to indicate the next thing for the sender to do.
Click to show internal directories.
Click to hide internal directories.