Documentation
¶
Overview ¶
Package fsnotifydeep extends fsnotify to make it work recursively. During an Add, all subdirectories are added as well. For a Remove, the same. As the contents of the monitored directories changes, fsnotify is updated accordingly.
In addition, fsnotifydeep adds a Filter feature to Watchers, allowing the client to specify a function literal that determines if an event should appear on the Events channel or be quietly dropped.
The primary downside of this package is a performance hit. The exact amount will depend on the size of the filesystem under monitor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FsnotifyFilter ¶
type FsnotifyFilter func(fsnotify.Event) bool
An FsnotifyFilter function accepts an event and returns true if that event passes the filter and should be accepted or false if the event should be dropped without notifying the client.
type Watcher ¶
type Watcher struct { Events chan fsnotify.Event Errors chan error // contains filtered or unexported fields }
Watcher watches a set of files, delivering events to a channel.
func NewWatcher ¶
NewWatcher establishes a new watcher, via fsnotify, begins waiting for events on the filesystem
func (*Watcher) Filter ¶
func (w *Watcher) Filter(filter FsnotifyFilter)
Filter adds a filter to watcher, causing only events which pass the filter function to be presented on the Events channel. If a nil filter is used, all events will be published (this is the default for a new Watcher).