go-asink/events.go
2013-02-11 23:17:12 -05:00

23 lines
276 B
Go

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
}