keventWaitTime = 100e6
)
-func newEvent(name string, mask uint32, create bool) *Event {
- e := new(Event)
- e.Name = name
+func newEvent(name string, mask uint32, create bool) Event {
+ e := Event{Name: name}
if create {
e.Op |= Create
}
externalWatches map[string]bool // Map of watches added by user of the library.
ewmut sync.Mutex // Protects access to externalWatches.
Errors chan error // Errors are sent on this channel
- Events chan *Event // Events are returned on this channel
+ Events chan Event // Events are returned on this channel
done chan bool // Channel for sending a "quit message" to the reader goroutine
isClosed bool // Set to true when Close() is first called
}
finfo: make(map[int]os.FileInfo),
fileExists: make(map[string]bool),
externalWatches: make(map[string]bool),
- Events: make(chan *Event),
+ Events: make(chan Event),
Errors: make(chan error),
done: make(chan bool, 1),
}
syscall.IN_MOVE_SELF | syscall.IN_DELETE | syscall.IN_DELETE_SELF
)
-func newEvent(name string, mask uint32) *Event {
- e := &Event{Name: name}
+func newEvent(name string, mask uint32) Event {
+ e := Event{Name: name}
if mask&syscall.IN_CREATE == syscall.IN_CREATE || mask&syscall.IN_MOVED_TO == syscall.IN_MOVED_TO {
e.Op |= Create
}
watches map[string]*watch // Map of inotify watches (key: path)
paths map[int]string // Map of watched paths (key: watch descriptor)
Errors chan error // Errors are sent on this channel
- Events chan *Event // Events are returned on this channel
+ Events chan Event // Events are returned on this channel
done chan bool // Channel for sending a "quit message" to the reader goroutine
isClosed bool // Set to true when Close() is first called
}
fd: fd,
watches: make(map[string]*watch),
paths: make(map[int]string),
- Events: make(chan *Event),
+ Events: make(chan Event),
Errors: make(chan error),
done: make(chan bool, 1),
}
sys_FS_Q_OVERFLOW = 0x4000
)
-func newEvent(name string, mask uint32) *Event {
- e := &Event{Name: name}
+func newEvent(name string, mask uint32) Event {
+ e := Event{Name: name}
if mask&sys_FS_CREATE == sys_FS_CREATE {
e.Op |= Create
}
port syscall.Handle // Handle to completion port
watches watchMap // Map of watches (key: i-number)
input chan *input // Inputs to the reader are sent on this channel
- Events chan *Event // Events are returned on this channel
+ Events chan Event // Events are returned on this channel
Errors chan error // Errors are sent on this channel
isClosed bool // Set to true when Close() is first called
quit chan chan<- error
port: port,
watches: make(watchMap),
input: make(chan *input, 1),
- Events: make(chan *Event, 50),
+ Events: make(chan Event, 50),
Errors: make(chan error),
quit: make(chan chan<- error, 1),
}