fswatcher

package
v0.85.0-pre.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: BSD-3-Clause Imports: 17 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) SetWatchPatterns

func (w *Watcher) SetWatchPatterns(patterns []string)

SetWatchPatterns updates the watch patterns and immediately reconciles.

func (*Watcher) Watch

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

type WatcherOptions

type WatcherOptions struct {
	WatchPatterns    []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