Documentation
¶
Overview ¶
Package mirror supervises mobility-aware continuous directory mirrors. Each job mirrors a local directory to a peer's mesh service, but ONLY while that peer is reachable (and same-LAN when LANOnly): it PAUSES when the mirrored pair becomes remote/absent and RESUMES — catching up via the engine's initial full sync — when the pair is local again (e.g. a laptop returns to the LAN). The transfer engine is coreutils/pkg/mirror (recursive watch + rclone sync, all permissive); the mesh integration is injected as a Linker so this package stays free of the mesh/peerplane import graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PollInterval = 15 * time.Second
PollInterval is how often each job re-checks the pair's reachability/locality.
Functions ¶
This section is empty.
Types ¶
type Linker ¶
type Linker interface {
// Reachable reports whether a peer offering service is reachable now — and,
// when lanOnly, on the same LAN. This is the resume(true)/pause(false) signal.
Reachable(ctx context.Context, service string, lanOnly bool) bool
// Open resolves a peer offering service and opens a forward to it, returning
// an rclone dest target (pointing at the local forward) + a stop func.
Open(ctx context.Context, service string) (dest string, stop func(), err error)
}
Linker is the mesh integration the supervisor needs (implemented in main.go).
type Supervisor ¶
type Supervisor struct {
Link Linker
Logger *slog.Logger
// contains filtered or unexported fields
}
Supervisor runs the configured mobility-aware mirror jobs.