watcher

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

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 is used to watch all existing os directories for changes. If changes are detected that match the Pattern, one "true" is sent to Changed after Debounce. Whatcher blocks, if no go routine is listening to Changed. The channel is closed when Close() is called so you can range over Changed.

func New

func New(globPattern string, debounce time.Duration) (*Watcher, error)

New returns a new Watcher that watches all already existing dirs of all os files matching with globPattern

func (*Watcher) Close

func (w *Watcher) Close() error

Close closes the underlying file system watcher

Jump to

Keyboard shortcuts

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