Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWatcherStarted = errors.New("watcher already started") ErrWatcherClosed = errors.New("watcher already closed") )
errors created by Watcher
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event represents a single file operation event
func (*Event) HasOps ¶
HasOps checks whether has any specified operation types
type Watcher ¶
type Watcher struct { Events chan Event Errors chan error // contains filtered or unexported fields }
Watcher watches for files or directory changes by polling currently, if multi operations applied to one file or directory, only one event (with single Op) will be sent the priority of Op is:
- Modify
- Chmod
- Rename / Move
- Create / Remove
func (*Watcher) Add ¶
Add adds named file or directory (non-recursively) to the watching list this can only be success if all events be sent (lock release)
func (*Watcher) Remove ¶
Remove removes named file or directory (non-recursively) from the watching list this can only be success if all events be sent (lock release)
Click to show internal directories.
Click to hide internal directories.