Fetching: - Add `fetch service`, which runs a worker per enabled source until SIGINT/SIGTERM (internal/fetcher) - Add util.Worker: runs a task on an interval with a since-checkpoint that only advances on success, and a shutdown timeout for in-flight work; plus AwaitTask/AwaitTaskE for calls that ignore cancellation - Add fts_mock and sleeper sources - Sleeper: sleeps periodically to emulate work being done. Can be instructed to block the shutdown signal or handle it cleanly Mock FTS server (cmd/mock-fts, internal/mock/findATender): - Serves GET /api/1.0/ocdsReleasePackages with FTS paging, query validation, UK local time handling and per-client rate limiting - Generates fictional releases from an embedded catalog, moving procedures through planning, tender and award, and keeps them in a JSON Lines store that survives restarts - Add logging.AccessLog for combined/common access logs
14 lines
490 B
Go
14 lines
490 B
Go
// Package mock implements a mock of the Find a Tender (FTS) OCDS release
|
|
// package endpoint (GET /api/1.0/ocdsReleasePackages): a catalog of buyers,
|
|
// suppliers, subjects and methods loaded from catalog.json, a persistent
|
|
// release store, a generator with a background worker, the HTTP handler and a
|
|
// per-client rate limiter.
|
|
package mock
|
|
|
|
// Files kept in the mock-data directory.
|
|
//
|
|
// ReleasesFile is created and appended to by the mock.
|
|
const (
|
|
ReleasesFile = "releases.jsonl"
|
|
)
|