Documentation
¶
Overview ¶
Package watchdriver runs the native file watchers of the backends on one goroutine each: the goroutine owns the system's handles, adds and removes targets between waits, and reports what the system tells it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface {
Add(platform.FileWatchTarget) error
Remove(id uint64)
Wait() ([]platform.FileWatchNotice, error)
Wake()
Close()
}
Driver is a backend's watcher. Every method but Wake runs on the goroutine of its Watch. Wait blocks until the system reports changes or Wake is called; an error it returns ends the watch.
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
Watch is a platform.FileWatch running a Driver.
func New ¶
func New(d Driver, notify func(platform.FileWatchNotice)) *Watch
New starts the goroutine of d, which calls notify with what d reports.
func (*Watch) Add ¶
func (w *Watch) Add(t platform.FileWatchTarget) error
Add enrolls t and returns once the driver has.