filewatch

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package filewatch coalesces filesystem notifications for mounted configuration files.

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 watches the parent directories of a set of files. Watching directories, rather than resolved file targets, preserves notifications when Kubernetes swaps a projected volume's ..data symlink.

func New

func New(paths []string, debounce, maxDebounce time.Duration, onChange func(), onError func(error)) (*Watcher, error)

New starts a watcher. Events are delayed until debounce has elapsed without a new event, but a continuous burst is delivered no later than maxDebounce after its first event. onError receives watcher errors; it must not assume an error is fatal. Paths are used only to select and deduplicate their parent directories.

func (*Watcher) Close

func (w *Watcher) Close() error

Close stops the watcher, cancels any pending debounce, and joins its goroutine. It is safe to call repeatedly.

Jump to

Keyboard shortcuts

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