watch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 7 Imported by: 0 modules, 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 watch provides an unprivileged, recursive inotify watcher used to detect changes to the working rootfs without polling/walking the whole tree (which is expensive on network filesystems). It works on any filesystem whose writes go through the kernel VFS, including the sandbox's bind-mounted rootfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher recursively watches a directory tree and coalesces change events.

func New

func New(root string, ignored func(rel string) bool) (*Watcher, error)

New starts watching root (and, recursively, its directories), skipping any path for which ignored returns true. ignored may be nil.

func (*Watcher) Changed

func (w *Watcher) Changed() <-chan struct{}

Changed delivers a coalesced signal whenever something under root changes.

func (*Watcher) Close

func (w *Watcher) Close()

Close stops the watcher and releases its fds.

func (*Watcher) Drain

func (w *Watcher) Drain() []string

Drain returns and clears the set of changed paths (rootfs-relative) observed so far — used to label snapshots with what actually changed.

Jump to

Keyboard shortcuts

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