Documentation
¶
Overview ¶
Package watching provides a uniform interface to native filesystem watching facilities.
Index ¶
Constants ¶
const ( // NonRecursiveWatchingSupported indicates whether or not the current // platform supports native non-recursive watching. NonRecursiveWatchingSupported = true )
const ( // RecursiveWatchingSupported indicates whether or not the current platform // supports native recursive watching. RecursiveWatchingSupported = false )
Variables ¶
This section is empty.
Functions ¶
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. Errors chan error // contains filtered or unexported fields }
NonRecursiveMRUWatcher represents a non-recursive native watcher that can watch multiple paths and evict old watches on an LRU-basis.
func NewNonRecursiveMRUWatcher ¶
func NewNonRecursiveMRUWatcher(events chan string, maximumWatches int) (*NonRecursiveMRUWatcher, error)
NewNonRecursiveMRUWatcher creates a new non-recursive watcher that will emit event paths on the specified events channel. The maximumWatcher argument sets the maximum number of watches allowed to exist before LRU-eviction occurs. If maximumWatches is 0, a default limit will be used. This function panics if the events channel is not buffered or the maximumWatches parameter is negative. Unlike recursive watching functions, event paths are not normalized to be root-relative, and delivery is on a best-effort basis (i.e. events will be dropped if not handled promptly).
func (*NonRecursiveMRUWatcher) Stop ¶
func (w *NonRecursiveMRUWatcher) Stop()
Stop terminates all watches.
func (*NonRecursiveMRUWatcher) Unwatch ¶
func (w *NonRecursiveMRUWatcher) Unwatch(path string)
Unwatch removes a watch path from the watcher. Any unwatching error will be reported through the errors channel.
func (*NonRecursiveMRUWatcher) Watch ¶
func (w *NonRecursiveMRUWatcher) Watch(path string)
Watch adds a watch path to the watcher. Any watching error will be reported through the errors channel.
Source Files
¶
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. |