watch

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher watches file system changes and notifies on relevant events

func New

func New() (*Watcher, error)

New creates a new file watcher

func (*Watcher) Add

func (w *Watcher) Add(path string) error

Add adds a path to watch (directory or file)

func (*Watcher) Close

func (w *Watcher) Close() error

Close stops the watcher and closes channels

func (*Watcher) Errors

func (w *Watcher) Errors() <-chan error

Errors returns the channel for watcher errors

func (*Watcher) Events

func (w *Watcher) Events() <-chan string

Events returns the channel for file change events

func (*Watcher) Remove

func (w *Watcher) Remove(path string) error

Remove removes a path from watching

func (*Watcher) SetDebounceDelay

func (w *Watcher) SetDebounceDelay(d time.Duration)

SetDebounceDelay sets the debounce delay (mainly for testing)

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context)

Start begins watching for file changes

Jump to

Keyboard shortcuts

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