filewatcher

package
v0.0.0-...-1bfb889 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileWatcher

func AddFileWatcher(fileWatcher FileWatcher, file string, callback func())

Types

type FileWatcher

type FileWatcher interface {

	// Add Start watching a path. Calling Add multiple times on the same path panics.
	Add(path string) error

	// Remove Stop watching a path. Removing a path that's not currently being watched panics.
	Remove(path string) error

	Close() error
	Events(path string) chan fsnotify.Event
	Errors(path string) chan error
}

FileWatcher is an interface that watches a set of files, delivering events to related channel.

func NewFileWatcher

func NewFileWatcher() FileWatcher

NewFileWatcher return with a FileWatcher instance that implemented with fsnotify.

func NewWatcher

func NewWatcher() FileWatcher

Jump to

Keyboard shortcuts

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