watcher

package
v2.37.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func NewFSNotify() (Watcher, error)

NewFSNotify creates a new file system watcher that watches parent directories instead of individual files for more reliable event detection.

func NewNoop

func NewNoop() Watcher

NewNoop creates a new watcher that does nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL