Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFolderPathNotFound = errors.New("could not find a folder path for watcher")
)
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface { OnCreate(ctx context.Context, path string, fileInfo os.FileInfo) OnRemove(ctx context.Context, path string, fileInfo os.FileInfo) OnWrite(ctx context.Context, path string, fileInfo os.FileInfo) OnRename(ctx context.Context, path string, fileInfo os.FileInfo, oldPath string) OnMove(ctx context.Context, path string, fileInfo os.FileInfo, oldPath string) }
EventHandler
type FolderWatcher ¶
type FolderWatcher struct {
// contains filtered or unexported fields
}
func New ¶
func New(configs ...Option) (*FolderWatcher, error)
New creates an new instance of folder watcher It listens to the path specified in the config space/folderPath
func (*FolderWatcher) Close ¶
func (fw *FolderWatcher) Close()
Close will stop the watching operation and unblock watch calls
func (*FolderWatcher) RegisterHandler ¶
func (fw *FolderWatcher) RegisterHandler(handler EventHandler)
Click to show internal directories.
Click to hide internal directories.