3 Star 4 Fork 0

包饺子 / watcher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 504 Bytes
一键复制 编辑 原始数据 按行查看 历史
wyd 提交于 2019-01-08 18:05 . build
package main
import (
"gitee.com/wydcn/watcher/lib"
"github.com/fsnotify/fsnotify"
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
)
func main () {
fBoby,err := ioutil.ReadFile("config.yml")
if err != nil {
log.Fatal(err)
}
var task []lib.Task
yaml.Unmarshal(fBoby,&task)
var done = make(chan bool)
var eventBus = make(chan fsnotify.Event)
log.Println("start watch")
go lib.Start(task,done,eventBus)
go lib.HanderEvent(eventBus,task)
log.Println("start loop")
go lib.TaskLoop()
<-done
}
Go
1
https://gitee.com/kannon01/watcher.git
git@gitee.com:kannon01/watcher.git
kannon01
watcher
watcher
master

搜索帮助