Separate watcher, create event object
This commit is contained in:
22
events.go
Normal file
22
events.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user