package
module
Version:
v0.1.3
Opens a new window with list of versions in this module.
Published: Jul 16, 2022
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Housekeeper
A tiny wrapper to create fsnotify recursive watchers with a framework like look and higher abstraction level sintax
Example usage
package main
import (
"log"
"github.com/gustapinto/housekeeper/observer"
"github.com/fsnotify/fsnotify"
)
type DotObserver struct{}
func (o *DotObserver) HandleEvent(event fsnotify.Event) {
switch event.Op {
case fsnotify.Create:
log.Print("Created: ", event.Name)
}
}
func (o *DotObserver) HandleError(err error) {
if err != nil {
log.Fatal(err)
}
}
func main() {
observer.Observe(".", &DotObserver{})
}
Documentation
¶
Observe Recursive watch a single root path and dispatch Observer handlers
ObserveMultiple Recursive watch multiple root paths and dispatch Observer handlers
Observer is the basic interface used on housekeeper functions
Source Files
¶
Click to show internal directories.
Click to hide internal directories.