Documentation ¶
Overview ¶
Package watcher watches a directory and reports back file system events
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrWatcherClosed is returned when the watcher is closed while waiting for an event ErrWatcherClosed = fmt.Errorf("The watcher was closed") )
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { // Name gets the name of the file associated with the event Name() string // Type gets the event type // Currently only create and Remove events are supported Type() EventType }
Event represents a file system event
type Watcher ¶
type Watcher interface { // Close closes the watcher. The path watched by the watcher is no longer being // watched for events Close() error // GetEvent gets the next file system event. The call will block until an event occurs. // The call can be unblocked by closing the channel argument GetEvent(chan struct{}) (Event, error) }
Watcher watches a path
Click to show internal directories.
Click to hide internal directories.