8000 GitHub - happsie/filewatcher
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

happsie/filewatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filey

A small practice project exploring some deeper systems programming. Currently only working on linux.

API

func main() {
	Backgroundwatcher := pkg.NewWatcher("./test") // directory to watch
	watcher.HandlerFunc(pkg.Modified, func(event pkg.WatchEvent) {
		slog.Info("modified - handler 1", "event", event)
	})
	watcher.HandlerFunc(pkg.Modified, func(event pkg.WatchEvent) {
		slog.Info("modified - handler 2", "event", event)
	})
	watcher.HandlerFunc(pkg.Created, func(event pkg.WatchEvent) {
		slog.Info("created - handler 1", "event", event)
	})
	watcher.Watch(context.Background()) // Blocking call, use go before to spin it up on a new go routine
}

Run tests

make all-tests 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0