watcher

package
v0.0.0-...-648c8e3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventError

type EventError struct {
	Err error
}

EventError represents an error when trying to catch events in the Watcher (fsnotify.Watcher)

func (*EventError) Error

func (e *EventError) Error() string

Allow EventError to satisfy error interface.

type Watcher

type Watcher struct {
	*fsnotify.Watcher
}

func InitWatcher

func InitWatcher() (*Watcher, error)

func (*Watcher) AddPathRecursive

func (w *Watcher) AddPathRecursive(root string)

(*fsnotify.Watcher).Add() function do not add recursively. AddPathRecursive recursively adds all directories inside the root path to the watcher.

func (*Watcher) AddPathRecursiveAndUpload

func (w *Watcher) AddPathRecursiveAndUpload(root, bucketname, rootDirObjectKey, profile string)

func (*Watcher) AddPathsAlreadyConfigured

func (w *Watcher) AddPathsAlreadyConfigured()

AddPathsAlreadyConfigured adds pre-configured paths to the watcher

func (*Watcher) RemovePathRecursive

func (w *Watcher) RemovePathRecursive(root string)

(*fsnotify.Watcher).Remove() function do not remove recursively. RemovePathRecursive recursively removes all sub-directories of the root path from the watcher.

func (*Watcher) Stop

func (w *Watcher) Stop()

Close path channels and lastly done channel to send stop signal to the watcher

func (*Watcher) Watch

func (w *Watcher) Watch() error

Watch watches and handles events async

type WatcherFailedInitError

type WatcherFailedInitError struct {
	Err error
}

WatcherFailedInitError represents an error when trying to init a Watcher (fsnotify.Watcher)

func (*WatcherFailedInitError) Error

func (e *WatcherFailedInitError) Error() string

Allow WatcherFailedInitError to satisfy error interface.

Jump to

Keyboard shortcuts

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