Documentation
¶
Overview ¶
Package watch re-renders a directory's context document when files change.
Index ¶
Constants ¶
View Source
const DefaultInterval = 500 * time.Millisecond
DefaultInterval is the debounce window applied to bursts of file events.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Root is the directory tree to watch.
Root string
// Ignore reports whether path should not trigger a re-render or be
// followed as a directory. Called with absolute paths.
Ignore func(path string) bool
// Interval is the debounce window; zero uses DefaultInterval.
Interval time.Duration
// OnChange re-renders the document after a quiet period. Called from the
// watch loop, so it must not block indefinitely.
OnChange func() error
}
Options configures a Watcher.
Click to show internal directories.
Click to hide internal directories.