Documentation
¶
Overview ¶
This package implements a polling-based file watcher designed for use by both the CLI watcher and the language server.
Index ¶
- type FileWatcher
- func (fw *FileWatcher) HasChangesFromWatchState() bool
- func (fw *FileWatcher) Run(now func() time.Time)
- func (fw *FileWatcher) SetPollInterval(d time.Duration)
- func (fw *FileWatcher) UpdateWatchState(paths []string, wildcardDirs map[string]bool)
- func (fw *FileWatcher) WaitForSettled(now func() time.Time)
- func (fw *FileWatcher) WatchStateEntry(path string) (WatchEntry, bool)
- func (fw *FileWatcher) WatchStateUninitialized() bool
- type WatchEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWatcher ¶
type FileWatcher struct {
// contains filtered or unexported fields
}
func NewFileWatcher ¶
func (*FileWatcher) HasChangesFromWatchState ¶
func (fw *FileWatcher) HasChangesFromWatchState() bool
HasChangesFromWatchState compares the current filesystem against the stored watch state. Safe for concurrent use: watchState and wildcardDirectories are snapshotted under lock; the maps themselves are never mutated after creation (UpdateWatchState replaces them).
func (*FileWatcher) Run ¶
func (fw *FileWatcher) Run(now func() time.Time)
func (*FileWatcher) SetPollInterval ¶
func (fw *FileWatcher) SetPollInterval(d time.Duration)
func (*FileWatcher) UpdateWatchState ¶
func (fw *FileWatcher) UpdateWatchState(paths []string, wildcardDirs map[string]bool)
func (*FileWatcher) WaitForSettled ¶
func (fw *FileWatcher) WaitForSettled(now func() time.Time)
func (*FileWatcher) WatchStateEntry ¶
func (fw *FileWatcher) WatchStateEntry(path string) (WatchEntry, bool)
func (*FileWatcher) WatchStateUninitialized ¶
func (fw *FileWatcher) WatchStateUninitialized() bool
Click to show internal directories.
Click to hide internal directories.