Fixed lint issues and missing documentation

This commit is contained in:
bwilliams committed 2026-10-13 12:21:32 +01:00
1 parent 7fd321df97
commit 6e6dec68c0
34 files changed
+346 -156

No files matched your search

+13 -13
View File
@@ -5,19 +5,19 @@ import (
"time"
)
// JSCKSources is the sources section's configuration key.
const JSCKSources string = "sources"
// Each field's cfg tag must match the section's JSCK* constant.
// JobSearchConfigSources configures each source of opportunities, one field
// per source. Each field's cfg tag must match the section's JSCK* constant.
type JobSearchConfigSources struct {
FindATender JobSearchConfigSourceFindATender `cfg:"find_a_tender"`
FTSMock JobSearchConfigSourceFTSMock `cfg:"fts_mock"`
Sleeper JobSearchConfigSourceSleeper `cfg:"sleeper"`
}
/*
* General section functions
* See related methods in section.go
*/
// ---------- Section methods (see Section) ----------
func (c JobSearchConfigSources) Map() map[string]any { return mapOf(c) }
func (c JobSearchConfigSources) Flatten() map[string]any {
@@ -36,19 +36,16 @@ func (c *JobSearchConfigSources) SetValue(key string, value any) error {
return setValue(c, key, value)
}
/*
*** Generic source definition, embedded in each source ***
*/
// ---------- Generic Source definition ----------
// JobSearchConfigSource holds the settings every source has, and is embedded
// in each source's section. Interval is how often an enabled source fetches.
type JobSearchConfigSource struct {
Enabled bool `cfg:"enabled"`
Interval time.Duration `cfg:"interval" default:"10m"`
}
/*
* General section functions
* See related methods in section.go
*/
func (c *JobSearchConfigSource) Keys() []string { return keysOf(c) }
// ---------- Section methods for Source (see Section) ----------
func (c JobSearchConfigSource) Map() map[string]any { return mapOf(c) }
@@ -67,3 +64,6 @@ func (c JobSearchConfigSource) ValueOf(key string) (any, error) {
func (c *JobSearchConfigSource) SetValue(key string, value any) error {
return setValue(c, key, value)
}
// Keys returns the keys directly in the section.
func (c *JobSearchConfigSource) Keys() []string { return keysOf(c) }