watcher

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type EventType
	Path string
}

Event represents a file system event

type EventType

type EventType int

EventType represents the type of file system event

const (
	EventCreate EventType = iota
	EventModify
	EventDelete
)

type Watcher

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

Watcher watches a directory for file changes

func New

func New(rootPath string, skipDirs []string, skipFiles []string, debounceMs int, logger *slog.Logger) (*Watcher, error)

New creates a new file system watcher

func (*Watcher) Events

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

Events returns the channel for receiving batched events

func (*Watcher) Start

func (w *Watcher) Start() error

Start starts watching the directory

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher

func (*Watcher) UpdateDebounceInterval

func (w *Watcher) UpdateDebounceInterval(intervalMs int)

UpdateDebounceInterval signals the watcher to update its debounce interval

Jump to

Keyboard shortcuts

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