From a0d157d45c5b4c63afc2cfc82bde3ae3207bc455 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Tue, 7 Jul 2026 09:03:31 +0200 Subject: Add Windows native watcher with Unix socket IPC Architecture: - Windows binary: watches files via ReadDirectoryChangesW (fsnotify), sends events as newline-delimited JSON over Unix domain socket - Container: performs initial sync, then listens on socket for events from Windows watcher New files: - cmd_windows.go: Windows serve command (watcher + socket server) - cmd_linux.go: Linux socket client + event listener - types.go: shared FileEvent, FileMeta, Manifest types - watcher_test_helper.go: inotify-based watcher for integration tests Changes: - main.go: simplified to just call run() - watcher.go: removed fsnotify dependency, extracted Watcher interface - sync.go: removed duplicate type definitions - watcher_test.go: uses watchForTests() helper Usage: sourcewatch.exe -dir C:\myproject -socket D:\sourcewatch.sock docker run -v D:\sourcewatch.sock:/run/sourcewatch.sock \ -v C:\myproject:/host:ro -v mydata:/data sourcewatch --- sync.go | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'sync.go') diff --git a/sync.go b/sync.go index 806b7a0..78f3fa8 100644 --- a/sync.go +++ b/sync.go @@ -8,17 +8,6 @@ import ( "time" ) -type FileMeta struct { - Size int64 - Mode os.FileMode - ModTime time.Time - Symlink string -} - -type Manifest struct { - Files map[string]FileMeta -} - type syncStats struct { files int dirs int -- cgit v1.2.3