arturoeanton / go-notify

It is only wrapper about github.com/fsnotify/fsnotify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-notify

Example

package main

import (
	"log"

	notify "github.com/arturoeanton/go-notify"
)

func main() {
	data := make(chan string)
	fx := func(observer *notify.ObserverNotify, event *notify.Event) {
		log.Println(observer.Filename, "  ", event.Name, "  ", event.Op.String())
	}

	notify.NewObserverNotify("./", "test.txt").
		FxCreate(fx).
		FxWrite(fx).
		FxChmod(fx).
		FxRemove(fx).
		FxRename(fx).
		Run()

	<-data
}

About

It is only wrapper about github.com/fsnotify/fsnotify

License:MIT License


Languages

Language:Go 100.0%