Documentation ¶
Index ¶
Constants ¶
const ( Chmod = fsnotify.Chmod Create = fsnotify.Create Remove = fsnotify.Remove Rename = fsnotify.Rename Write = fsnotify.Write )
Provide access to the underlying fsnotify ops.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchedRecursiveWatcher ¶
type BatchedRecursiveWatcher struct {
// contains filtered or unexported fields
}
BatchedRecursiveWatcher is an instance of a recursive watcher that batches events. Create a new BatchedRecursiveWatcher via NewBatchedRecursiveWatcher.
func NewBatchedRecursiveWatcher ¶
func NewBatchedRecursiveWatcher(dir, gittoplevel string, batchWindow time.Duration, opts ...Option) (*BatchedRecursiveWatcher, error)
NewBatchedRecursiveWatcher creates a new batched watcher. A BatchedRecursiveWatcher's Events are batched into windows of at most batchWindow duration. Furthermore, if gittoplevel is supplied, events received during git operations are batched until the end of the git operation. This can mean that batch time windows can be less than batchWindow when a git operation starts before a time window expires. It can also mean that a batch captures events over a time period greater than batchWindow, when a git operation exceeds this duration.
func (*BatchedRecursiveWatcher) Close ¶
func (bw *BatchedRecursiveWatcher) Close() error
Close shuts down the watcher, by removing all watches and closing the Events channel.
func (*BatchedRecursiveWatcher) Errors ¶
func (bw *BatchedRecursiveWatcher) Errors() <-chan error
func (*BatchedRecursiveWatcher) Events ¶
func (bw *BatchedRecursiveWatcher) Events() <-chan []fsnotify.Event
type RecursiveWatcher ¶
type RecursiveWatcher struct {
// contains filtered or unexported fields
}
RecursiveWatcher is an instance of a recursive watcher. Create a new RecursiveWatcher via NewRecursiveWatcher.
func NewRecursiveWatcher ¶
func NewRecursiveWatcher(rootDir string, opts ...Option) (*RecursiveWatcher, error)
NewRecursiveWatcher creates a new recursive watcher rooted at directory rootDir.
func (*RecursiveWatcher) Close ¶
func (w *RecursiveWatcher) Close() error
Close shuts down the watcher, by removing all watches and closing the Events channel.
func (*RecursiveWatcher) Errors ¶
func (w *RecursiveWatcher) Errors() <-chan error
func (*RecursiveWatcher) Events ¶
func (w *RecursiveWatcher) Events() <-chan fsnotify.Event