Directory watcher that monitors a folder for new files, waits for them to settle (no writes for a configurable duration), then uploads them to a godocs server.
go install github.com/drummonds/godocs-watcher@latestOr download from releases.
Generate a config file:
godocs-watcher -initEdit godocs-watcher.yaml:
godocs_server: http://localhost:8000
watch_dir: /home/user/scans
settle_time: 30s
delete_after_upload: falseRun:
godocs-watcherThe watcher will:
- Scan existing files in
watch_diron startup - Watch for new/modified files via fsnotify
- Wait until a file has no writes for
settle_time - Upload to godocs via
POST /api/document/upload - Optionally delete the source file after successful upload
Dotfiles and directories are ignored.
| Field | Default | Description |
|---|---|---|
godocs_server |
(required) | URL of the godocs server |
watch_dir |
(required) | Directory to watch |
settle_time |
30s |
Duration with no writes before uploading |
delete_after_upload |
false |
Remove source file after successful upload |
task build # build binary
task check # fmt + vet + test| Documentation | https://h3-godocs-watcher.statichost.page/ |
| Source (Codeberg) | https://codeberg.org/hum3/godocs-watcher |
| Mirror (GitHub) | https://github.com/drummonds/godocs-watcher |
| Docs repo | https://codeberg.org/hum3/godocs-watcher-docs |