file

package
v0.0.0-...-c936f35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

func Watch(filename string) *Watcher

Watch creates a new file watcher for the given filename.

func (*Watcher) Unsubscribe

func (w *Watcher) Unsubscribe()

Unsubscribe stops listening for updates and frees any resources used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL