1
0
Fork 0
go-asink/events.go

23 lines
276 B
Go
Raw Normal View History

2013-02-11 23:16:19 -05:00
package main
type EventType uint32
const (
2013-02-11 23:17:12 -05:00
UPDATE = 1 << iota
2013-02-11 23:16:19 -05:00
DELETE
)
type Event struct {
Type EventType
Path string
Hash string
}
func (e Event) IsUpdate() bool {
2013-02-11 23:17:12 -05:00
return e.Type&UPDATE == UPDATE
2013-02-11 23:16:19 -05:00
}
func (e Event) IsDelete() bool {
2013-02-11 23:17:12 -05:00
return e.Type&DELETE == DELETE
2013-02-11 23:16:19 -05:00
}