Separate watcher, create event object

This commit is contained in:
2013-02-11 23:16:19 -05:00
parent 4651d05c34
commit 54a0359897
4 changed files with 83 additions and 32 deletions

22
events.go Normal file
View File

@ -0,0 +1,22 @@
package main
type EventType uint32
const (
UPDATE = 1 << iota
DELETE
)
type Event struct {
Type EventType
Path string
Hash string
}
func (e Event) IsUpdate() bool {
return e.Type & UPDATE == UPDATE
}
func (e Event) IsDelete() bool {
return e.Type & DELETE == DELETE
}