watcher

package
v0.36.4 Latest Latest
Warning

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

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

Documentation

Overview

Package watcher reports changes under a source tree, so the spec can be regenerated on save.

New walks the tree once and watches every directory in it, skipping the ones a scan would never read. It is best effort by design: when a watcher cannot be created the caller falls back to rescanning on demand, so the TUI stays usable on platforms and filesystems where watching does not work.

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 reports Go-source changes under a directory tree as a coalesced stream of signals.

It watches every (non-vendored, non-hidden) directory in the tree - fsnotify is not recursive - and re-adds directories created at runtime so new packages are picked up. Bursts collapse into a single pending signal; the model debounces further before rescanning.

func New

func New(root string) (*Watcher, error)

func (*Watcher) Close

func (w *Watcher) Close() error

Close stops watching and tears down the goroutine.

func (*Watcher) Events

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

Jump to

Keyboard shortcuts

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