godocs-watcher
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.
Install
go install github.com/drummonds/godocs-watcher@latest
Or download from releases.
Usage
Generate a config file:
godocs-watcher -init
Edit godocs-watcher.yaml:
godocs_server: http://localhost:8000
watch_dir: /home/user/scans
settle_time: 30s
delete_after_upload: false
Run:
godocs-watcher
The 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.
Config
| 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 |
Build
task build # build binary
task check # fmt + vet + test
Links
| 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 |