Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WatchDirectory ¶
type WatchDirectory struct { // Path is the path to the directory to watch. Path string // Filter is the filter to apply to the directory. Filter string // Recursive is true if the directory should be watched recursively. Recursive bool // MatchFunction is the function to use to match files. MatchFunction func(string) bool // Callback is the function to call when a file is created that matches with MatchFunction. CallbackFunction func(string) // watcher is the fsnotify watcher. Watcher *fsnotify.Watcher }
WatchDirectory watches a directory for changes.
func NewDirectoryWatcher ¶
func NewDirectoryWatcher(path string, recursive bool, matchFunction func(string) bool, callbackFunction func(string)) *WatchDirectory
NewWatchDirectory creates a new WatchDirectory.
func (*WatchDirectory) Stop ¶ added in v1.2.1
func (w *WatchDirectory) Stop() error
func (*WatchDirectory) UpdatePath ¶ added in v1.2.1
func (w *WatchDirectory) UpdatePath(path string) error
func (*WatchDirectory) Watch ¶
func (w *WatchDirectory) Watch() error
Click to show internal directories.
Click to hide internal directories.