-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8009bcf
commit 762c7ae
Showing
15 changed files
with
1,132 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package internal | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
// File event mask constants. | ||
const ( | ||
FileEventCreated = 1 << iota | ||
FileEventModified | ||
FileEventDeleted | ||
) | ||
|
||
// FileEvent represents an event on a watched file. | ||
type FileEvent struct { | ||
Name string | ||
Mask int | ||
} | ||
|
||
// ErrFileEventQueueOverflow is returned when the file event queue has overflowed. | ||
var ErrFileEventQueueOverflow = errors.New("file event queue overflow") | ||
|
||
// FileWatcher represents a watcher of file events. | ||
type FileWatcher interface { | ||
Open() error | ||
Close() error | ||
|
||
// Returns a channel of events for watched files. | ||
Events() <-chan FileEvent | ||
|
||
// Adds a specific file to be watched. | ||
Watch(filename string) error | ||
|
||
// Removes a specific file from being watched. | ||
Unwatch(filename string) error | ||
} |
Oops, something went wrong.