Documentation
¶
Index ¶
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
}
FileWatcher uses fsnotify to watch a file's directory for changes.
func NewFileWatcher ¶
func NewFileWatcher(path string) (*FileWatcher, error)
NewFileWatcher creates a watcher using fsnotify. It watches the parent directory to handle atomic saves (vim, VS Code).
func (*FileWatcher) Content ¶
func (fw *FileWatcher) Content() <-chan string
type NoopWatcher ¶
type NoopWatcher struct {
// contains filtered or unexported fields
}
NoopWatcher is used for stdin input where there's nothing to watch.
func NewNoopWatcher ¶
func NewNoopWatcher() *NoopWatcher
NewNoopWatcher creates a watcher that never sends updates.
func (*NoopWatcher) Content ¶
func (nw *NoopWatcher) Content() <-chan string
type PollWatcher ¶
type PollWatcher struct {
// contains filtered or unexported fields
}
PollWatcher uses stat-based polling for environments where fsnotify doesn't work.
func NewPollWatcher ¶
func NewPollWatcher(path string, interval time.Duration) *PollWatcher
NewPollWatcher creates a stat-based polling watcher.
func (*PollWatcher) Content ¶
func (pw *PollWatcher) Content() <-chan string
Click to show internal directories.
Click to hide internal directories.