package filenotify

import "github.com/docker/cli/components/engine/pkg/filenotify"

Package filenotify provides a mechanism for watching file(s) for changes. Generally leans on fsnotify, but provides a poll-based notifier which fsnotify does not support. These are wrapped up in a common interface so that either can be used interchangeably in your code.

Index

Types

type FileWatcher

type FileWatcher interface {
	Events() <-chan fsnotify.Event
	Errors() <-chan error
	Add(name string) error
	Remove(name string) error
	Close() error
}

FileWatcher is an interface for implementing file notification watchers

func New

func New() (FileWatcher, error)

New tries to use an fs-event watcher, and falls back to the poller if there is an error

func NewEventWatcher

func NewEventWatcher() (FileWatcher, error)

NewEventWatcher returns an fs-event based file watcher

func NewPollingWatcher

func NewPollingWatcher() FileWatcher

NewPollingWatcher returns a poll-based file watcher

Source Files

filenotify.go fsnotify.go poller.go

Version
v17.10.0-ce-rc1+incompatible
Published
Oct 4, 2017
Platform
js/wasm
Imports
7 packages
Last checked
5 minutes ago

Tools for package owners.