mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:58:45 +02:00
refactor(watcher): rename events package to watcherEvents
- Updated import paths and references from events to watcherEvents across multiple files
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/yusing/godoxy/internal/watcher/events"
|
||||
watcherEvents "github.com/yusing/godoxy/internal/watcher/events"
|
||||
"github.com/yusing/goutils/task"
|
||||
)
|
||||
|
||||
@@ -117,18 +117,18 @@ func (h *DirWatcher) start() {
|
||||
}
|
||||
|
||||
msg := Event{
|
||||
Type: events.EventTypeFile,
|
||||
Type: watcherEvents.EventTypeFile,
|
||||
ActorName: relPath,
|
||||
}
|
||||
switch {
|
||||
case fsEvent.Has(fsnotify.Write):
|
||||
msg.Action = events.ActionFileWritten
|
||||
msg.Action = watcherEvents.ActionFileWritten
|
||||
case fsEvent.Has(fsnotify.Create):
|
||||
msg.Action = events.ActionFileCreated
|
||||
msg.Action = watcherEvents.ActionFileCreated
|
||||
case fsEvent.Has(fsnotify.Remove):
|
||||
msg.Action = events.ActionFileDeleted
|
||||
msg.Action = watcherEvents.ActionFileDeleted
|
||||
case fsEvent.Has(fsnotify.Rename):
|
||||
msg.Action = events.ActionFileRenamed
|
||||
msg.Action = watcherEvents.ActionFileRenamed
|
||||
default: // ignore other events
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user