Documentation
¶
Overview ¶
Package watcher provides file system watching capabilities for the agent. It defines an interface for monitoring file changes and implementations that can be used to detect when configuration files are modified. This is primarily used to track changes to devcontainer configuration files and notify users when containers need to be recreated to apply the new configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = xerrors.New("watcher closed")
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher interface { // Add starts watching a file for changes. Add(file string) error // Remove stops watching a file for changes. Remove(file string) 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 stream that clients can consume to react to changes.
func NewFSNotify ¶
NewFSNotify creates a new file system watcher that watches parent directories instead of individual files for more reliable event detection.