fs

package
v0.0.0-...-6b10bcf Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSChangeHandler

type FSChangeHandler interface {
	OnCreate(string)
	OnUpdate(string)
	OnRemove(string)
}

FSChangeHandler provides a callback mechanism used by the FileWatcher to notify about changes to monitored directory or file.

type FileWatcher

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

FileWatcher uses fsnotify to watch file system changes done to files or directories, notifying the respective handlers. It is recommended to watch directories over files (you can add filters to limit the scope of files to be observed).

func NewWatcher

func NewWatcher() (*FileWatcher, error)

func (*FileWatcher) Add

func (w *FileWatcher) Add(name string, handler FSChangeHandler, filters ...*regexp.Regexp)

func (*FileWatcher) Start

func (w *FileWatcher) Start(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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