Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Path string
}
Event notifies about a changed/created/moved file. It contains the path of the file relative to the root folder of the watcher.
type Watcher ¶
type Watcher struct { // Events is an unbuffered channel. It receives the filesystem changes as Event instances. // The channel will be closed when the watcher is closed with watcher.Close(). Events chan (Event) // contains filtered or unexported fields }
Watcher represents a watch from a folder recusrsively down the tree.
func New ¶
New creates a new watcher instance and starts listening for filechanges.
The root parameter must be a path to the watched folder.
The exclude array contains a list of folders that are recursively excluded from the watcher. So an exclude of ".git" will not listen for any changes in the .git folder and any subdirectories. The exclude matcher syntax allows paths in the form of `root/**/dist/asset*/ba[rz]/*.gen.ts`. see (gobwas)[https://pkg.go.dev/github.com/gobwas/glob#Compile] for more details.