fnotify

package
v0.0.0-...-5eee607 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDebounce is how long to wait after a file change notification
	// before firing an event.
	DefaultDebounce = 250 * time.Millisecond

	// DefaultRemonitorDelay is how long to wait after a file is removed to see
	// if it will reappear and must be remonitored.
	DefaultRemonitorDelay = 500 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	Debounce       time.Duration
	RemonitorDelay time.Duration
	// contains filtered or unexported fields
}

A Notifier monitors files on a local filesystem for changes.

func New

func New(name string) *Notifier

New creates a file change notifier named name.

func (*Notifier) Close

func (n *Notifier) Close() error

Close shuts down the notifier asynchronously.

func (*Notifier) Notify

func (n *Notifier) Notify(files []string, res chan<- string) error

Notify synchronously watches the list of files for changes, writing changed filenames to res. Notify blocks unless monitoring fails, so it must be run in a goroutine.

Jump to

Keyboard shortcuts

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