fsw

package
v0.0.0-...-419c0c3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Op

func Op(s string) fsnotify.Op

Types

type HandlerFunc

type HandlerFunc func(ctx context.Context, payload []fsnotify.Event)

type HandlerOption

type HandlerOption func(*Route)

func Events

func Events(eventOp string) HandlerOption

func Handle

func Handle(handler HandlerFunc) HandlerOption

func Match

func Match(match ...string) HandlerOption

func Throttle

func Throttle(throttle time.Duration) HandlerOption

type Options

type Options struct {
	Root     []string
	Exclude  []string
	Event    string
	Throttle time.Duration
}

type Route

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

func (*Route) Run

func (r *Route) Run(ctx context.Context)

type Watcher

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

func New

func New(options Options) *Watcher

func (*Watcher) Add

func (w *Watcher) Add(dir string)

递归添加

func (*Watcher) Handle

func (w *Watcher) Handle(name string, options ...HandlerOption)

func (*Watcher) Remove

func (w *Watcher) Remove(fullPath string)

递归删除

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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