Documentation
¶
Overview ¶
Package watch provides file watching for automatic re-linting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Paths are the files or directories to watch.
Paths []string
// Recursive watches directories recursively.
Recursive bool
// Debounce is the duration to wait before triggering callback.
// Multiple events within this window are coalesced.
Debounce time.Duration
// Include patterns for files to watch.
Include []string
// Exclude patterns for files to ignore.
Exclude []string
}
Config configures the watcher.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default watcher configuration.
type Event ¶
type Event struct {
// Path is the path to the changed file.
Path string
// Op is the operation that triggered the event.
Op fsnotify.Op
// Time is when the event occurred.
Time time.Time
}
Event represents a file change event.
Click to show internal directories.
Click to hide internal directories.