watch

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 7 Imported by: 0

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