aboutsummaryrefslogtreecommitdiff
path: root/internal/watcher/watcher.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/watcher/watcher.go')
-rw-r--r--internal/watcher/watcher.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go
new file mode 100644
index 0000000..303eced
--- /dev/null
+++ b/internal/watcher/watcher.go
@@ -0,0 +1,20 @@
+package watcher
+
+import "time"
+
+type Watcher struct {
+ config Config
+
+ debounce chan struct{}
+}
+
+func New(config Config) *Watcher {
+ if config.Debounce <= 0 {
+ config.Debounce = 500 * time.Millisecond
+ }
+
+ return &Watcher{
+ config: config,
+ debounce: make(chan struct{}, 1),
+ }
+}