- a source's interval must be greater than 0: a source is turned off with enabled, not with a zero interval, so JSCSourcesSource rejects an interval of 0 or less (its validate is promoted to each source's section); - max_message_size rejects -1: JSCServerWebSocket rejects a max_message_size of -1 (util.ByteSizeNoLimit), as a client could then exhaust the server's memory; - every setting documents what 0 or empty means (zero/none, no limit or a default).
35 lines
914 B
Go
35 lines
914 B
Go
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 and must be set when
|
|
// the source is enabled.
|
|
type JSCSourceFTSMock struct {
|
|
JSCSourcesSource
|
|
APIRoot string `cfg:"api_root"`
|
|
}
|
|
|
|
// ---------- Section methods (see Section) ----------
|
|
|
|
func (c JSCSourceFTSMock) Map() map[string]any { return mapOf(c) }
|
|
|
|
func (c JSCSourceFTSMock) Flatten() map[string]any {
|
|
return flattenOf(JSCKSourceFTSMock, c)
|
|
}
|
|
|
|
func (c JSCSourceFTSMock) TypeOf(key string) (reflect.Kind, error) {
|
|
return typeOf(c, key)
|
|
}
|
|
|
|
func (c JSCSourceFTSMock) ValueOf(key string) (any, error) {
|
|
return valueOf(c, key)
|
|
}
|
|
|
|
func (c *JSCSourceFTSMock) SetValue(key string, value any) error {
|
|
return setValue(c, key, value)
|
|
}
|