fswatcher

package
v0.0.0-...-e225f37 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nop = Op{}
)

Functions

This section is empty.

Types

type Event

type Event struct {
	fsnotify.Event
}

func (Event) Has

func (ev Event) Has(op fsnotify.Op) bool

type Handler

type Handler func(fname string)

type Op

type Op struct {
	fsnotify.Op
}

func (Op) String

func (op Op) String() string

type Watcher

type Watcher struct {
	*fsnotify.Watcher

	WaitBeforeFileClose time.Duration
	WaitAfterHandler    time.Duration
	Verbose             bool

	FileCreated Handler
	//FileWritten Handler
	//FileWritten func(fname string)
	FileClosed  Handler
	FileRemoved Handler
	// contains filtered or unexported fields
}

func New

func New() *Watcher

New starts and returns a new watcher

func (*Watcher) Add

func (w *Watcher) Add(filesOrFolders ...path.AbsPath) error

Add one or more paths to watch

func (*Watcher) Close

func (w *Watcher) Close() error

Jump to

Keyboard shortcuts

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