- 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).
37 lines
942 B
Go
37 lines
942 B
Go
package config
|
|
|
|
import (
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
// JSCKServerTimeouts is the server timeouts section's configuration key.
|
|
const JSCKServerTimeouts string = "timeouts"
|
|
|
|
// JSCServerTimeouts configures the server's timeouts. ShutdownTimeout is how
|
|
// long shutdown waits for clients to close; 0 or less means it waits until
|
|
// they have.
|
|
type JSCServerTimeouts struct {
|
|
ShutdownTimeout time.Duration `cfg:"shutdown" default:"15s"`
|
|
}
|
|
|
|
// ---------- Section methods (see Section) ----------
|
|
|
|
func (c JSCServerTimeouts) Map() map[string]any { return mapOf(c) }
|
|
|
|
func (c JSCServerTimeouts) Flatten() map[string]any {
|
|
return flattenOf(JSCKServerTimeouts, c)
|
|
}
|
|
|
|
func (c JSCServerTimeouts) TypeOf(key string) (reflect.Kind, error) {
|
|
return typeOf(c, key)
|
|
}
|
|
|
|
func (c JSCServerTimeouts) ValueOf(key string) (any, error) {
|
|
return valueOf(c, key)
|
|
}
|
|
|
|
func (c *JSCServerTimeouts) SetValue(key string, value any) error {
|
|
return setValue(c, key, value)
|
|
}
|