Documentation
¶
Overview ¶
Package watcher implements the file system watcher using fsnotify.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebouncedEvent ¶
type DebouncedEvent struct {
Path string
ChangeType events.FileChangeType
Timer *time.Timer
}
DebouncedEvent represents a debounced file change event.
type Debouncer ¶
type Debouncer struct {
// contains filtered or unexported fields
}
Debouncer coalesces rapid file system events.
func NewDebouncer ¶
func NewDebouncer(window time.Duration, callback func(path string, changeType events.FileChangeType)) *Debouncer
NewDebouncer creates a new debouncer with the given window and callback.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher implements the FileWatcher port interface.
func NewWatcher ¶
func NewWatcher(rootPath string, hub ports.EventHub, debounceMS int, ignorePatterns []string) *Watcher
NewWatcher creates a new file system watcher.
func NewWatcherWithWorkspace ¶
func NewWatcherWithWorkspace(rootPath string, hub ports.EventHub, debounceMS int, ignorePatterns []string, workspaceID string) *Watcher
NewWatcherWithWorkspace creates a new file system watcher with workspace context attached to emitted events.
func (*Watcher) AddIgnorePattern ¶
AddIgnorePattern adds a pattern to the ignore list.
func (*Watcher) RemoveIgnorePattern ¶
RemoveIgnorePattern removes a pattern from the ignore list.
Click to show internal directories.
Click to hide internal directories.