Documentation ¶
Index ¶
- type Watcher
- func (w *Watcher) AddGlob(pattern string) error
- func (w *Watcher) AddPath(path string) error
- func (w *Watcher) All(f func(fsnotify.Event, os.FileInfo, error) error)
- func (w *Watcher) Done()
- func (w *Watcher) List() []string
- func (w *Watcher) On(event fsnotify.Op, f func(fsnotify.Event, os.FileInfo, error) error) error
- func (w *Watcher) WalkPath(path string) error
- func (w *Watcher) Watch() error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher represents a wrapper around `fsnotify` complete with support for its own callbacks for all supported event types.
func (*Watcher) AddGlob ¶
AddGlob will monitor the specified "glob" pattern and add all valid files to the current watcher instance for monitoring.
func (*Watcher) AddPath ¶ added in v0.0.2
AddFile adds a single valid file to the current Watcher instance and returns an error if the file is not valid.
func (*Watcher) Done ¶
func (w *Watcher) Done()
Done signals a blocking channel that processing is complete and that we can safely exit the current watcher instance.
func (*Watcher) List ¶ added in v0.0.2
List is a wrapper around `fsnotify.Watchlist()`. It returns a list of strings representing all files and directories currently monitored instance of `fsnotify`.
func (*Watcher) On ¶
On fires off an assigned callback for each event type. Only specified events are supported and all will return either nil or an error. Every watcher instance exits when it first encounters an error.
func (*Watcher) WalkPath ¶ added in v0.0.2
AddDir will recursively walk the specified directory tree and add all valid files to the current watcher instance for monitoring.