go-asink/events.go

23 lines
281 B
Go
Raw Normal View History

2013-02-11 23:16:19 -05:00
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
}