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