docker: github.com/docker/docker/pkg/filenotify Index | Files

package filenotify

import "github.com/docker/docker/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

Package Files

filenotify.go fsnotify.go poller.go

type FileWatcher Uses

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 Uses

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 Uses

func NewEventWatcher() (FileWatcher, error)

NewEventWatcher returns an fs-event based file watcher

func NewPollingWatcher Uses

func NewPollingWatcher() FileWatcher

NewPollingWatcher returns a poll-based file watcher

Package filenotify imports 7 packages (graph) and is imported by 367 packages. Updated 2019-09-18. Refresh now. Tools for package owners.