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
33 lines
771 B
Go
33 lines
771 B
Go
package config
|
|
|
|
import "reflect"
|
|
|
|
const JSCKSourceSleeper string = "sleeper"
|
|
|
|
type JobSearchConfigSourceSleeper struct {
|
|
JobSearchConfigSource
|
|
BlockShutdown bool `cfg:"block_shutdown"`
|
|
}
|
|
|
|
/*
|
|
* General section functions
|
|
* See related methods in section.go
|
|
*/
|
|
func (c JobSearchConfigSourceSleeper) Map() map[string]any { return mapOf(c) }
|
|
|
|
func (c JobSearchConfigSourceSleeper) Flatten() map[string]any {
|
|
return flattenOf(JSCKSourceSleeper, c)
|
|
}
|
|
|
|
func (c JobSearchConfigSourceSleeper) TypeOf(key string) (reflect.Kind, error) {
|
|
return typeOf(c, key)
|
|
}
|
|
|
|
func (c JobSearchConfigSourceSleeper) ValueOf(key string) (any, error) {
|
|
return valueOf(c, key)
|
|
}
|
|
|
|
func (c *JobSearchConfigSourceSleeper) SetValue(key string, value any) error {
|
|
return setValue(c, key, value)
|
|
}
|