filewatcher

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInt

type ClientInt interface {
	Add(path string) error
	Start(exit <-chan struct{})
}

ClientInt is a file watcher abstraction based on fsnotify.

func NewFileWatcher

func NewFileWatcher(eventHandler EventHandler, errorHandler ErrorHandler) (ClientInt, error)

NewFileWatcher returns an implementation of ClientInt that continuously listens for fsnotify events and calls the event handler as soon as an event is received.

type ErrorHandler

type ErrorHandler func(error)

ErrorHandler is called when a fsnotify error occurs.

type EventHandler

type EventHandler func(fsnotify.Event)

EventHandler is called when a fsnotify event occurs.

Jump to

Keyboard shortcuts

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