watcher

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 3 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 {
	OnChange func(filePath string) // callback a user can set to listen for changes
	OnError  func(err error)       // callback a user can set to listen for errors
	// contains filtered or unexported fields
}

Watcher is a wrapper around fsnotify to provide a slightly better API. The intention is to eventually extend it.

func WatchPath

func WatchPath(pathToFile string) (*Watcher, error)

WatchPath creates a "file watcher" that will notify you when the given file has been updated

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher, releases all resources, ...

Jump to

Keyboard shortcuts

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