Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct { Pattern string Changed chan bool Debounce time.Duration // contains filtered or unexported fields }
Watcher watches existing os directories that contain Pattern matches for infrequent file changes like manual saving or git-like operations. Directories created after calling New are not watched for FS changes. If FS changes are detected that match Pattern, one "true" is sent to Changed not before Debounce. Changes within the Debounce interval retrigger the Debounce pause, so frequent and continued FS changes will probably never trigger any sending to Changed. Watcher's file system watching routine blocks, if no go routine is listening to Changed. The Changed channel is closed when Close() is called so you can range over Changed.