watchers

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package watchers provides mechanism to subscribe events under given directory.

Index

Constants

This section is empty.

Variables

View Source
var ErrWatcherNotRunning = errors.New("context is already canceled")

ErrWatcherNotRunning is returned when method is called after Watcher context cancellation. This error can safely be ignored when this is returned by Watcher.Unsubscribe because the context and all subscriptions are already cancelled.

Functions

This section is empty.

Types

type Watcher

type Watcher interface {
	Subscribe(string, string, func(string)) error
	Unsubscribe(string) error
}

Watcher defines an interface that all file system watcher must satisfy.

func Run

func Run(ctx context.Context) (Watcher, error)

Run initializes internal watcher and returns Watcher interface. When Run is completed, construction is all done and it is safe to call Watcher.Subscribe for additional subscription.

Jump to

Keyboard shortcuts

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