watcher

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 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 {
	Path   string
	Rel    string
	Op     Op
	Exists bool
	IsDir  bool
	Time   time.Time
}

type Handler

type Handler func(event Event)

type Op

type Op uint8
const (
	OpUnknown Op = iota
	OpCreate
	OpWrite
	OpRemove
	OpRename
	OpChmod
)

func (Op) String

func (op Op) String() string

type Option

type Option func(*Watcher)

func WithDebounce

func WithDebounce(duration time.Duration) Option

type Watcher

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

func New

func New(root string, opts ...Option) (*Watcher, error)

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) Subscribe

func (w *Watcher) Subscribe(filter string, handler Handler) error

func (*Watcher) Watch

func (w *Watcher) Watch(rel string) error

func (*Watcher) WatchRecursive

func (w *Watcher) WatchRecursive(rel string) error

Jump to

Keyboard shortcuts

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