Documentation
¶
Overview ¶
Package watcher provides an inotify-based approach for watching file system events from a directory recursively.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEvent ¶
type CreateEvent struct {
// contains filtered or unexported fields
}
CreateEvent represents the creation of a file or directory.
func (CreateEvent) IsDir ¶
func (ce CreateEvent) IsDir() bool
IsDir returns whether the event item is a directory.
func (CreateEvent) String ¶
func (ce CreateEvent) String() string
func (CreateEvent) WatcherEvent ¶
func (ce CreateEvent) WatcherEvent() string
WatcherEvent returns a string representation of the event.
type DeleteEvent ¶
type DeleteEvent struct {
// contains filtered or unexported fields
}
DeleteEvent represents the removal of a file or directory.
func (DeleteEvent) IsDir ¶
func (de DeleteEvent) IsDir() bool
IsDir returns whether the event item is a directory.
func (DeleteEvent) String ¶
func (de DeleteEvent) String() string
func (DeleteEvent) WatcherEvent ¶
func (de DeleteEvent) WatcherEvent() string
WatcherEvent returns a string representation of the event.
type ModifyEvent ¶
type ModifyEvent struct {
// contains filtered or unexported fields
}
ModifyEvent represents the modification of a file or directory.
func (ModifyEvent) IsDir ¶
func (me ModifyEvent) IsDir() bool
IsDir returns whether the event item is a directory.
func (ModifyEvent) String ¶
func (me ModifyEvent) String() string
func (ModifyEvent) WatcherEvent ¶
func (me ModifyEvent) WatcherEvent() string
WatcherEvent returns a string representation of the event.
type RenameEvent ¶
type RenameEvent struct { // OldPath can be equal to "" if the old path is from an unwatched directory. OldPath string // contains filtered or unexported fields }
RenameEvent represents the moving of a file or directory.
func (RenameEvent) IsDir ¶
func (re RenameEvent) IsDir() bool
IsDir returns whether the event item is a directory.
func (RenameEvent) Path ¶
func (re RenameEvent) Path() string
Path returns the event item's path. Path can be equal to "" if the new path is from an unwatched directory.
func (RenameEvent) String ¶
func (re RenameEvent) String() string
func (RenameEvent) WatcherEvent ¶
func (re RenameEvent) WatcherEvent() string
WatcherEvent returns a string representation of the event.
type W ¶
type W struct {
// contains filtered or unexported fields
}
W is a watcher for a directory.
func New ¶
New creates a watcher for dirPath recursively, ignoring any path that matches at least one of ignoreRegExps. Directory paths matched against ignoreRegExps end with a /.