Fallback to file polling for jsonlog reader on err
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
55c8a5b21b
commit
2d5e8bce1c
4 changed files with 396 additions and 0 deletions
18
filenotify/fsnotify.go
Normal file
18
filenotify/fsnotify.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package filenotify
|
||||
|
||||
import "gopkg.in/fsnotify.v1"
|
||||
|
||||
// fsNotify wraps the fsnotify package to satisfy the FileNotifer interface
|
||||
type fsNotifyWatcher struct {
|
||||
*fsnotify.Watcher
|
||||
}
|
||||
|
||||
// GetEvents returns the fsnotify event channel receiver
|
||||
func (w *fsNotifyWatcher) Events() <-chan fsnotify.Event {
|
||||
return w.Watcher.Events
|
||||
}
|
||||
|
||||
// GetErrors returns the fsnotify error channel receiver
|
||||
func (w *fsNotifyWatcher) Errors() <-chan error {
|
||||
return w.Watcher.Errors
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue