summaryrefslogtreecommitdiffstats
path: root/watcher/filenotify/fsnotify.go
diff options
context:
space:
mode:
Diffstat (limited to 'watcher/filenotify/fsnotify.go')
-rw-r--r--watcher/filenotify/fsnotify.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/watcher/filenotify/fsnotify.go b/watcher/filenotify/fsnotify.go
new file mode 100644
index 000000000..19534128a
--- /dev/null
+++ b/watcher/filenotify/fsnotify.go
@@ -0,0 +1,20 @@
+// Package filenotify is adapted from https://github.com/moby/moby/tree/master/pkg/filenotify, Apache-2.0 License.
+// Hopefully this can be replaced with an external package sometime in the future, see https://github.com/fsnotify/fsnotify/issues/9
+package filenotify
+
+import "github.com/fsnotify/fsnotify"
+
+// fsNotifyWatcher wraps the fsnotify package to satisfy the FileNotifier interface
+type fsNotifyWatcher struct {
+ *fsnotify.Watcher
+}
+
+// Events returns the fsnotify event channel receiver
+func (w *fsNotifyWatcher) Events() <-chan fsnotify.Event {
+ return w.Watcher.Events
+}
+
+// Errors returns the fsnotify error channel receiver
+func (w *fsNotifyWatcher) Errors() <-chan error {
+ return w.Watcher.Errors
+}