fswatcher

package
v0.85.0-pre.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evt

type Evt struct {
	Path       string
	Op         Op
	IsKnownDir bool
}

func (*Evt) IsCreate

func (e *Evt) IsCreate() bool

func (*Evt) IsDelete

func (e *Evt) IsDelete() bool

func (*Evt) IsEdit

func (e *Evt) IsEdit() bool

type Op

type Op string
const (
	OpCreate Op = "create"
	OpEdit   Op = "edit"
	OpDelete Op = "delete"
)

type Watcher

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

func NewWatcher

func NewWatcher(opts ...WatcherOptions) *Watcher

func (*Watcher) SetWatchRoot

func (w *Watcher) SetWatchRoot(new_root string)

SetWatchRoot updates the watch root and immediately reconciles.

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context, on_evt_batch func([]Evt) error)

type WatcherOptions

type WatcherOptions struct {
	WatchRoot        string
	IgnorePatterns   []string
	DebounceDuration time.Duration
	Logger           *slog.Logger
	OnAddPath        func(path string)
	OnRemovePath     func(path string)
}

Jump to

Keyboard shortcuts

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