directory_watcher

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

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

Jump to

Keyboard shortcuts

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