watching

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package watching provides a uniform interface to native filesystem watching facilities.

Index

Constants

View Source
const (
	// NonRecursiveWatchingSupported indicates whether or not the current
	// platform supports native non-recursive watching.
	NonRecursiveWatchingSupported = false
)
View Source
const (
	// RecursiveWatchingSupported indicates whether or not the current platform
	// supports native recursive watching.
	RecursiveWatchingSupported = true
)

Variables

This section is empty.

Functions

func WatchRecursive

func WatchRecursive(context context.Context, target string, events chan string) error

WatchRecursive performs recursive watching on platforms which support doing so natively. The function will stobe the events channel with an empty path after the watch has been established. After this function returns, no more events will be written to the events channel.

Types

type NonRecursiveMRUWatcher

type NonRecursiveMRUWatcher struct {
	// Errors is a buffer channel (with a capacity of one) that will populated
	// with the first internal error that occurs in the watcher. If an error
	// occurs, the watcher should be stopped. It will never be populated on this
	// platform.
	Errors chan error
}

NonRecursiveMRUWatcher represents a non-recursive native watcher that can watch multiple paths and evict old watches on an LRU-basis.

func NewNonRecursiveMRUWatcher

func NewNonRecursiveMRUWatcher(_ chan string, _ int) (*NonRecursiveMRUWatcher, error)

NewNonRecursiveMRUWatcher creates a new non-recursive watcher that will emit event paths on the specified events channel. This function is not implemented on this platform and will panic if called.

func (*NonRecursiveMRUWatcher) Stop

func (w *NonRecursiveMRUWatcher) Stop()

Stop terminates all watches. This method is not implemented on this platform and will panic if called.

func (*NonRecursiveMRUWatcher) Unwatch

func (w *NonRecursiveMRUWatcher) Unwatch(_ string) error

Unwatch removes a watch path from the watcher. This method is not implemented on this platform and will panic if called.

func (*NonRecursiveMRUWatcher) Watch

func (w *NonRecursiveMRUWatcher) Watch(_ string) error

Watch adds a watch path to the watcher. This method is not implemented on this platform and will panic if called.

Directories

Path Synopsis
internal
third_party/winfsnotify
Package winfsnotify allows the user to receive file system event notifications on Windows.
Package winfsnotify allows the user to receive file system event notifications on Windows.

Jump to

Keyboard shortcuts

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