Documentation ¶
Overview ¶
Package watcher that handles file renames
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WatchFile ¶
func WatchFile(ctx context.Context, path string, handler func(ctx context.Context) error) (*fsnotify.Watcher, error)
WatchFile is a resilient file watcher that handles file renames Special features:
- This debounces multiple quick changes before invoking the callback
- After the callback, resubscribe to the file to handle file renames that change the file inode path to watch handler to invoke on change
This returns the fsnotify watcher. Close it when done.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.