summaryrefslogtreecommitdiffstats
path: root/watcher
diff options
context:
space:
mode:
authorJorin Vogel <hi@jorin.me>2017-08-02 14:25:05 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-08-03 15:57:51 +0200
commit81c13171a985b89f2af6682dbd1d4b8766cb9af7 (patch)
treedb39d78bbe6da0ea3f3dd3d2f94c7e1571ad8fd6 /watcher
parent9891c0fb0eb274b8a95b62c40070a87a6e04088c (diff)
Add some missing doc comments
As pointed out by the linter, some exported functions and types are missing doc comments. The linter warnings have been reduced from 194 to 116. Not all missing comments have been added in this commit though.
Diffstat (limited to 'watcher')
-rw-r--r--watcher/batcher.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/watcher/batcher.go b/watcher/batcher.go
index 0b4083e81..6f4b276cf 100644
--- a/watcher/batcher.go
+++ b/watcher/batcher.go
@@ -19,6 +19,7 @@ import (
"github.com/fsnotify/fsnotify"
)
+// Batcher batches file watch events in a given interval.
type Batcher struct {
*fsnotify.Watcher
interval time.Duration
@@ -27,6 +28,7 @@ type Batcher struct {
Events chan []fsnotify.Event // Events are returned on this channel
}
+// New creates and starts a Batcher with the given time interval.
func New(interval time.Duration) (*Batcher, error) {
watcher, err := fsnotify.NewWatcher()
@@ -64,6 +66,7 @@ OuterLoop:
close(b.done)
}
+// Close stops the watching of the files.
func (b *Batcher) Close() {
b.done <- struct{}{}
b.Watcher.Close()