-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevent.go
More file actions
35 lines (31 loc) · 673 Bytes
/
event.go
File metadata and controls
35 lines (31 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package cloudwatcher
// Event is the struct that contains the info about the changed file
type Event struct {
Key string // Path of file
Type Op // File operation
Object interface{} // Object pointer
}
// Op defines the event's type
type Op uint32
// event's types
const (
FileCreated = iota
FileChanged
FileDeleted
TagsChanged
)
// TypeString returns a text version of the event's type
func (e *Event) TypeString() string {
switch e.Type {
case FileCreated:
return "FileCreated"
case FileChanged:
return "FileChanged"
case FileDeleted:
return "FileDeleted"
case TagsChanged:
return "TagsChanged"
default:
return "unknown"
}
}