Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // Path holds the absolute path to the file/directory. Path string // Op defines the file/directory operation. Op Op }
Event instances are passed to Subscriber implementations on file/directory activity.
type Fsnotify ¶
type Fsnotify struct {
// contains filtered or unexported fields
}
func (*Fsnotify) AddSubscriber ¶
func (w *Fsnotify) AddSubscriber(sub Subscriber) error
func (*Fsnotify) RemovePath ¶
type Subscriber ¶
Subscriber implementations receive Event and error values.
type Watcher ¶
type Watcher interface { // AddSubscriber appends the list of subscribers that receive event/error details. AddSubscriber(Subscriber) error // AddPath appends the file/directory (non-recursive) to the watch list and // begins monitoring in a new goroutine. // // Absolute and relative paths are supported. However all paths are made absolute internally. AddPath(string) error // RemovePath stops the file/directory (non-recursive) from being watched. // // Absolute and relative paths are supported. RemovePath(string) error // Close ends all monitoring behavior and clears the watch/subscriber list. Close() error // Set the amount of time to wait for duplicate events (same Event.String output value) // to be received before broadcasting one Event value to subscribers. // // Implementations should not debounce events if this method is not called. Debounce(time.Duration) }
Click to show internal directories.
Click to hide internal directories.