barista.run: barista.run/base/watchers/file Index | Files

package file

import "barista.run/base/watchers/file"

Package file uses the fsnotify library to watch for changes to files.

Index

Package Files

file.go

type Watcher Uses

type Watcher struct {
    Updates <-chan struct{}
    Errors  <-chan error
    // contains filtered or unexported fields
}

Watcher watches for changes to a single named file or directory. It notifies the Updates chan on any changes to the watched file, while also handling parts of the path hierarchy to the file being removed and recreated.

func Watch Uses

func Watch(filename string) *Watcher

Watch creates a new file watcher for the given filename.

func (*Watcher) Unsubscribe Uses

func (w *Watcher) Unsubscribe()

Unsubscribe stops listening for updates and frees any resources used.

Package file imports 7 packages (graph) and is imported by 1 packages. Updated 2019-01-13. Refresh now. Tools for package owners.