Split fetch from jobsearch into a separate fetcher command, and renamed fetch once to fts-once
job-search no longer has a fetch command. Its subcommands are now in cmd/fetcher, which reads the same configuration: "fetcher service" runs every enabled source's fetcher on its interval until stopped, and "fetcher fts-once" (was "fetch once") fetches from Find a Tender once and prints the releases as JSON. The new namea say what the commands do, because service runs every source while fts-once fetches only from Find a Tender. The code stays in internal/cli/fetch, where NewCommands replaces the fetch parent command. once.go is now fts_once.go and commandOnce is commandFTSOnce. The README's usage, the config README and the find_a_tender api_root comment now give the new command names.
This commit is contained in:
1 parent
5e61c11eb9
commit
ac44b45f06
11 files changed
+155
-44
No files matched your search
@@ -57,8 +57,6 @@ Global flags: `--config`/`-c` (config file), `--debug`/`-d` and
|
||||
|
||||
| Command | Purpose |
|
||||
|---|---|
|
||||
| `job-search fetch service` | Poll every enabled source on its interval until stopped (Ctrl+C or SIGTERM) |
|
||||
| `job-search fetch once` | Fetch from Find a Tender once and print the releases as JSON |
|
||||
| `job-search config init [path]` | Create a config file |
|
||||
| `job-search config show` | Print the configuration (`--json` or `--yaml` for those formats) |
|
||||
| `job-search config get <key>` | Print one value, e.g. `logging.level` |
|
||||
@@ -70,17 +68,28 @@ Global flags: `--config`/`-c` (config file), `--debug`/`-d` and
|
||||
| `job-search migrate status` | Show the database version and which migrations are applied or pending |
|
||||
| `job-search version` | Print version information |
|
||||
|
||||
`fetch service` logs to `logging.file` if it's set, or to the terminal with
|
||||
`--foreground`. Both fetch commands take `--since "YYYY-MM-DD[ hh:mm:ss]"`.
|
||||
`fetch once` can be limited with `--planning`, `--opportunities` or
|
||||
`--awards`, and with `--ignore-rate-limit` it fails on a rate limit instead
|
||||
of waiting.
|
||||
|
||||
The `migrate` commands work on the database in `database.file`. The store
|
||||
refuses to open a database that isn't at this build's schema version, so run
|
||||
`job-search migrate` after installing a new version.
|
||||
|
||||
|
||||
## Fetch tool
|
||||
`fetcher` reads the same configuration as `job-search`:
|
||||
|
||||
| Command | Purpose |
|
||||
|---|---|
|
||||
| `fetcher service` | Poll every enabled source on its interval until stopped (Ctrl+C or SIGTERM) |
|
||||
| `fetcher fts-once` | Fetch from Find a Tender once and print the releases as JSON |
|
||||
|
||||
`service` logs to `logging.file` if it's set, or to the terminal with
|
||||
`--foreground`. Both commands take `--since "YYYY-MM-DD[ hh:mm:ss]"`.
|
||||
`fts-once` can be limited with `--planning`, `--opportunities` or
|
||||
`--awards`, and with `--ignore-rate-limit` it fails on a rate limit instead
|
||||
of waiting.
|
||||
|
||||
During development, `go run ./cmd/fetcher` works as well.
|
||||
|
||||
|
||||
## Mock Find a Tender server
|
||||
To develop without using the real API, run the mock and enable the `fts_mock`
|
||||
source:
|
||||
@@ -115,6 +124,7 @@ check), `--url` and `--timeout`; see `ws-test dial --help`.
|
||||
| Path | Contents |
|
||||
|---|---|
|
||||
| `cmd/jobsearch` | The `job-search` command |
|
||||
| `cmd/fetcher` | The `fetcher` command (Find a Tender fetch, the polling service) |
|
||||
| `cmd/mock-fts` | The mock FTS server |
|
||||
| `cmd/ws-test` | The `ws-test` WebSocket test tool |
|
||||
| `internal/cli` | Cobra commands and shared CLI setup |
|
||||
|
||||
Reference in new issue
Block a user