watcher
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package watcher provides file system watching capabilities for theagent. It defines an interface for monitoring file changes andimplementations that can be used to detect when configuration filesare modified. This is primarily used to track changes to devcontainerconfiguration files and notify users when containers need to berecreated to apply the new configuration.
Index¶
Constants¶
This section is empty.
Variables¶
var ErrClosed =xerrors.New("watcher closed")
Functions¶
This section is empty.
Types¶
typeWatcher¶
type Watcher interface {// Add starts watching a file for changes.Add(filestring)error// Remove stops watching a file for changes.Remove(filestring)error// Next blocks until a file system event occurs or the context is canceled.// It returns the next event or an error if the watcher encountered a problem.Next(context.Context) (*fsnotify.Event,error)// Close shuts down the watcher and releases any resources.Close()error}
Watcher defines an interface for monitoring file system changes.Implementations track file modifications and provide an event streamthat clients can consume to react to changes.
funcNewFSNotify¶
NewFSNotify creates a new file system watcher that watches parent directoriesinstead of individual files for more reliable event detection.