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. type JSCRateLimitRule struct { Enabled bool `cfg:"enabled" default:"false"` PerSecond int `cfg:"per_second" default:"50"` Burst int `cfg:"burst" default:"100"` } // ---------- Section methods (see Section) ---------- func (c JSCRateLimitRule) Map() map[string]any { return mapOf(c) } func (c JSCRateLimitRule) Flatten() map[string]any { return flattenOf("", c) } func (c JSCRateLimitRule) TypeOf(key string) (reflect.Kind, error) { return typeOf(c, key) } func (c JSCRateLimitRule) ValueOf(key string) (any, error) { return valueOf(c, key) } func (c *JSCRateLimitRule) SetValue(key string, value any) error { return setValue(c, key, value) }