watcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWatchBudget = errors.New("watch budget exhausted; observing a partial tree")

ErrWatchBudget reports that the directory cap was reached. Directories registered before the cap keep working.

Functions

This section is empty.

Types

type Ignorer

type Ignorer interface {
	Prune(path string) bool
	Ignored(ctx context.Context, path string) bool
}

Ignorer prunes paths from observation. Prune must be cheap — it is asked once per directory of a full tree walk. Ignored may consult the repository and is used only for paths that appear while the watcher is running.

type Watcher

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

func New

func New(delay time.Duration, scan func(context.Context, bool)) (*Watcher, error)

func (*Watcher) Add

func (w *Watcher) Add(root string, ignore Ignorer) error

Add watches root and its non-ignored descendants. ignore may be nil, which watches everything except .git; real workspaces must pass their repository's rules or ignored build trees pin a descriptor per file until the service exits.

func (*Watcher) Rescan

func (w *Watcher) Rescan(ctx context.Context)

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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