rfsnotify

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 5 Imported by: 0

README

rfsnotify

recursive directory notifications built as a wrapper around fsnotify (golang)

GoDoc

This is a thin wrapper around https://github.com/fsnotify/fsnotify instead of only monitoring a top level folder, it allows you to monitor all folders underneath the folder you specify.

Example:

An example can be found here.

Documentation

Overview

Package rfsnotify implements recursive folder monitoring by wrapping the excellent fsnotify library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirFilter

type DirFilter func(path string, info os.FileInfo) bool

DirFilter is a function to filter folder to watch

type Watcher

type Watcher struct {
	Events chan fsnotify.Event
	Errors chan error
	// contains filtered or unexported fields
}

Watcher wraps fsnotify.Watcher. When fsnotify adds recursive watches, you should be able to switch your code to use fsnotify.Watcher

func NewBufferedWatcher added in v0.2.0

func NewBufferedWatcher(bufferSize int) (*Watcher, error)

NewBufferedWatcher establishes a new watcher with the underlying OS and begins waiting for events. The channel used to receive the FS events is buffered with the given size.

func NewWatcher

func NewWatcher() (*Watcher, error)

NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.

func (*Watcher) Add

func (w *Watcher) Add(name string) error

Add starts watching the named file or directory (non-recursively).

func (*Watcher) AddRecursive

func (w *Watcher) AddRecursive(name string, dirFilter DirFilter) error

AddRecursive starts watching the named directory and all sub-directories.

func (*Watcher) Close

func (w *Watcher) Close()

Close removes all watches and closes the events channel.

func (*Watcher) Remove

func (w *Watcher) Remove(name string) error

Remove stops watching the named file or directory (non-recursively).

func (*Watcher) RemoveRecursive

func (w *Watcher) RemoveRecursive(name string) error

RemoveRecursive stops watching the named directory and all sub-directories.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL