diff --git a/internal/control/control.go b/internal/control/control.go index 7d58878..48b7557 100644 --- a/internal/control/control.go +++ b/internal/control/control.go @@ -41,6 +41,16 @@ type MountState struct { BaseSnapshot string `json:"base_snapshot"` } +// Daemon is the slice of the running daemon the control server steers. The +// daemon package implements it; declared here (not in the build-tagged server +// files) so the real server and the Windows stub share one definition and can't +// drift. The server depends on this behaviour, not the daemon package — no cycle. +type Daemon interface { + StateSnapshot() State // live per-mount + paused view for GET /state + Pause() // stop syncing until resumed + Resume() // clear pause + catch up all mounts +} + // ErrNotRunning is returned by the client helpers when the control socket is // absent or unreachable — i.e. the daemon isn't running — so callers can fall // back to disk-based behaviour instead of treating it as a hard error. diff --git a/internal/control/server.go b/internal/control/server.go index 4f98ef9..b5d5979 100644 --- a/internal/control/server.go +++ b/internal/control/server.go @@ -11,15 +11,6 @@ import ( "time" ) -// Daemon is the slice of the running daemon the control server steers. The -// daemon package implements it; kept here so the server depends on a behaviour, -// not on the daemon package (no import cycle). -type Daemon interface { - StateSnapshot() State // live per-mount + paused view for GET /state - Pause() // stop syncing until resumed - Resume() // clear pause + catch up all mounts -} - // Server hosts the control API on a Unix socket. The zero value is unusable; // build one with Serve. type Server struct { diff --git a/internal/control/server_windows.go b/internal/control/server_windows.go index ba15b3a..f152d43 100644 --- a/internal/control/server_windows.go +++ b/internal/control/server_windows.go @@ -13,13 +13,6 @@ import ( // net.Listen("unix", …) in server.go for winio.ListenPipe and the client's // net.Dial for winio.DialPipe. Until a Windows user exists, we don't build it. -// Daemon is the slice of the running daemon the control server would steer. -type Daemon interface { - StateSnapshot() State - Pause() - Resume() -} - // Server is a no-op on Windows. type Server struct{} @@ -28,6 +21,3 @@ type Server struct{} func Serve(_ context.Context, _ string, _ Daemon, _ func(string, ...any)) (*Server, error) { return nil, errors.New("control socket not supported on windows yet") } - -// Publish is a no-op on Windows. -func (s *Server) Publish(_, _ string) {}