README ¶ fswatcher A handy wrapper around fsnotify with deduplication watcher := fswatcher.New([]string{"/tmp/your-file.txt"}, 0) defer watcher.Stop() go watcher.Start(func(e fsnotify.Event){ // do something with event }) Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Constants type Watcher func New(files []string, delay time.Duration) (*Watcher, error) func (w *Watcher) Start(handler func(e fsnotify.Event)) func (w *Watcher) Stop() error Constants ¶ View Source const DefaultDelay = 100 * time.Millisecond DefaultDelay to avoid unnecessary handler calls Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Watcher ¶ type Watcher struct { // contains filtered or unexported fields } Watcher of file system changes func New ¶ func New(files []string, delay time.Duration) (*Watcher, error) Creates FS Watcher func (*Watcher) Start ¶ func (w *Watcher) Start(handler func(e fsnotify.Event)) Start watcher func (*Watcher) Stop ¶ func (w *Watcher) Stop() error Stop watcher Source Files ¶ View all Source files fswatcher.go Click to show internal directories. Click to hide internal directories.