Documentation
¶
Overview ¶
Package watcher provides file system monitoring functionality for the GitCells application.
Index ¶
- type Config
- type Debouncer
- func (d *Debouncer) Cancel(key string)
- func (d *Debouncer) CancelAll()
- func (d *Debouncer) Debounce(key string, fn func())
- func (d *Debouncer) GetDelay() time.Duration
- func (d *Debouncer) GetPendingKeys() []string
- func (d *Debouncer) HasPending() bool
- func (d *Debouncer) SetDelay(delay time.Duration)
- type EventHandler
- type EventType
- type FileEvent
- type FileWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Debouncer ¶
type Debouncer struct {
// contains filtered or unexported fields
}
Debouncer prevents rapid successive calls by delaying execution
func NewDebouncer ¶
NewDebouncer creates a new debouncer with the specified delay
func (*Debouncer) CancelAll ¶
func (d *Debouncer) CancelAll()
CancelAll cancels all pending debounced functions
func (*Debouncer) Debounce ¶
Debounce delays the execution of fn until delay has passed since the last call
func (*Debouncer) GetPendingKeys ¶
GetPendingKeys returns all keys that have pending debounced functions
func (*Debouncer) HasPending ¶
HasPending returns true if there are any pending debounced functions
type EventHandler ¶
type FileWatcher ¶
type FileWatcher struct {
// contains filtered or unexported fields
}
func NewFileWatcher ¶
func NewFileWatcher(config *Config, handler EventHandler, logger *logrus.Logger) (*FileWatcher, error)
func (*FileWatcher) AddDirectory ¶
func (fw *FileWatcher) AddDirectory(path string) error
func (*FileWatcher) GetWatchedDirectories ¶
func (fw *FileWatcher) GetWatchedDirectories() []string
func (*FileWatcher) IsWatching ¶
func (fw *FileWatcher) IsWatching(path string) bool
func (*FileWatcher) RemoveDirectory ¶
func (fw *FileWatcher) RemoveDirectory(path string) error
func (*FileWatcher) Start ¶
func (fw *FileWatcher) Start() error
func (*FileWatcher) Stop ¶
func (fw *FileWatcher) Stop() error