Config changes
- 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).
This commit is contained in:
1 parent
49b824d5a2
commit
0b5fde9563
11 files changed
+116
-23
No files matched your search
@@ -2,12 +2,14 @@ package config
|
||||
|
||||
import "reflect"
|
||||
|
||||
// JSCRateLimitRule configures one rate limit. The type is used under several
|
||||
// keys so it has no JSCK* constant and its Flatten keys are not prefixed.
|
||||
// JSCRateLimitRule configures one rate limit: PerSecond sustained, with
|
||||
// bursts of up to Burst. It is off unless Enabled and PerSecond is greater
|
||||
// than 0; a Burst below 1 means 1. The type is used under several keys so it
|
||||
// has no JSCK* constant and its Flatten keys are not prefixed.
|
||||
type JSCRateLimitRule struct {
|
||||
Enabled bool `cfg:"enabled" default:"false"`
|
||||
Enabled bool `cfg:"enabled" default:"false"`
|
||||
PerSecond int `cfg:"per_second" default:"50"`
|
||||
Burst int `cfg:"burst" default:"100"`
|
||||
Burst int `cfg:"burst" default:"100"`
|
||||
}
|
||||
|
||||
// ---------- Section methods (see Section) ----------
|
||||
|
||||
Reference in new issue
Block a user