fsnotify.go (715B)
1 // Package filenotify is adapted from https://github.com/moby/moby/tree/master/pkg/filenotify, Apache-2.0 License.
2 // Hopefully this can be replaced with an external package sometime in the future, see https://github.com/fsnotify/fsnotify/issues/9
3 package filenotify
4
5 import "github.com/fsnotify/fsnotify"
6
7 // fsNotifyWatcher wraps the fsnotify package to satisfy the FileNotifier interface
8 type fsNotifyWatcher struct {
9 *fsnotify.Watcher
10 }
11
12 // Events returns the fsnotify event channel receiver
13 func (w *fsNotifyWatcher) Events() <-chan fsnotify.Event {
14 return w.Watcher.Events
15 }
16
17 // Errors returns the fsnotify error channel receiver
18 func (w *fsNotifyWatcher) Errors() <-chan error {
19 return w.Watcher.Errors
20 }