package config import "reflect" // JSCKSourceFTSMock is the Find a Tender mock source's configuration key. const JSCKSourceFTSMock string = "fts_mock" // JSCSourceFTSMock configures fetching from a Find a Tender mock // server (cmd/mock-fts) at APIRoot, which has no default. Empty: the source // fails to start if it is enabled. RateLimitRetries is as for // JSCSourceFindATender. type JSCSourceFTSMock struct { JSCSourcesSource APIRoot string `cfg:"api_root"` RateLimitRetries int `cfg:"rate_limit_retries" default:"5"` } // ---------- Section methods (see Section) ---------- // Map implements Section. func (c JSCSourceFTSMock) Map() map[string]any { return mapOf(c) } // Flatten implements Section. func (c JSCSourceFTSMock) Flatten() map[string]any { return flattenOf(JSCKSourceFTSMock, c) } // TypeOf implements Section. func (c JSCSourceFTSMock) TypeOf(key string) (reflect.Kind, error) { return typeOf(c, key) } // ValueOf implements Section. func (c JSCSourceFTSMock) ValueOf(key string) (any, error) { return valueOf(c, key) } // SetValue implements Section. func (c *JSCSourceFTSMock) SetValue(key string, value any) error { return setValue(c, key, value) } // ---------- Section specific methods ---------- // validate checks values before they are stored (see validator), as // JSCSourcesSource's does, which this one hides. rate_limit_retries can't be // negative. func (c *JSCSourceFTSMock) validate(key string, value any) error { return validateRateLimitRetries(&c.JSCSourcesSource, key, value) }