Documentation
¶
Overview ¶
Package watch keeps session files synced continuously. fsnotify drives prompt, debounced uploads of changed files; a periodic poll catches roots the OS watcher cannot cover (network filesystems, watch exhaustion); and a slow full rescan is the safety net for anything both missed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Debounce time.Duration // quiet period before uploading a changed file
Poll time.Duration // mtime/size re-stat interval for the polling fallback
Discover time.Duration // interval to re-walk the roots for newly created files
Rescan time.Duration // full rediscover-and-sync safety net interval
// Excludes are glob patterns of paths to skip (see discover.Excluder). They
// keep an ignored location out of discovery, the poll, and event handling.
Excludes []string
Logf func(string, ...any)
}
Options tune the watch timers. Zero values fall back to defaults.
type SyncFunc ¶
SyncFunc syncs one file. watch depends on this rather than the concrete syncer so it can be tested without a server.
Click to show internal directories.
Click to hide internal directories.