watcher

package
v0.0.0-...-2920ad6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 4 Imported by: 1

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:

  1. This debounces multiple quick changes before invoking the callback
  2. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL